aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-11 20:05:31 -0700
committerEric Wong <normalperson@yhbt.net>2008-10-12 05:27:32 -0700
commit3402a7c25566176da698cd90ad166e93a2560e3d (patch)
treecb62afcbffec0a4484844f2a3809d8b91d0c1331 /src
parent0df62a2c3cb7af88347d40a17cc336b5d1740f62 (diff)
downloadmpd-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 'src')
-rw-r--r--src/gcc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gcc.h b/src/gcc.h
index 7492e6cad..6bd85663d 100644
--- a/src/gcc.h
+++ b/src/gcc.h
@@ -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_