diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-11 20:05:31 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-12 05:27:32 -0700 |
commit | 3402a7c25566176da698cd90ad166e93a2560e3d (patch) | |
tree | cb62afcbffec0a4484844f2a3809d8b91d0c1331 | |
parent | 0df62a2c3cb7af88347d40a17cc336b5d1740f62 (diff) | |
download | mpd-3402a7c25566176da698cd90ad166e93a2560e3d.tar.gz mpd-3402a7c25566176da698cd90ad166e93a2560e3d.tar.xz mpd-3402a7c25566176da698cd90ad166e93a2560e3d.zip |
gcc: define mpd_sizeof_str_flex_array
This can save a few bytes here on newer gcc and there and will
hopefully make it more obvious what we're doing with
that last struct element
Diffstat (limited to '')
-rw-r--r-- | src/gcc.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -32,6 +32,10 @@ # define mpd_must_check __attribute__ ((warn_unused_result)) # define mpd_noreturn __attribute__ ((noreturn)) # define mpd_packed __attribute__ ((packed)) + +/* str_flex_array is always >= 1 because we always 0 terminate strings */ +# define mpd_sizeof_str_flex_array 1 + /* these are very useful for type checking */ # define mpd_printf __attribute__ ((format(printf,1,2))) # define mpd_fprintf __attribute__ ((format(printf,2,3))) @@ -52,6 +56,7 @@ # define mpd_must_check # define mpd_noreturn # define mpd_packed +# define mpd_sizeof_str_flex_array (sizeof(size_t)) # define mpd_printf # define mpd_fprintf # define mpd_fprintf_ |