diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-06-24 21:49:16 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-06-30 14:29:41 +0200 |
commit | c234b4b0c0c59c4e972d0832aefc6a94f41f4e1f (patch) | |
tree | 703c310d3ec392606cc364876137e3d77092dfad /lib | |
parent | 75e9f2110876137a57632d223248ac51dbfc4569 (diff) | |
download | samba-c234b4b0c0c59c4e972d0832aefc6a94f41f4e1f.tar.gz samba-c234b4b0c0c59c4e972d0832aefc6a94f41f4e1f.tar.bz2 samba-c234b4b0c0c59c4e972d0832aefc6a94f41f4e1f.zip |
lib/util/string_wrappers: move everything into one HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS block
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jun 30 14:29:41 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util/string_wrappers.h | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/lib/util/string_wrappers.h b/lib/util/string_wrappers.h index 37384fc5a3..6f2d6e9122 100644 --- a/lib/util/string_wrappers.h +++ b/lib/util/string_wrappers.h @@ -23,24 +23,6 @@ #ifndef _STRING_WRAPPERS_H #define _STRING_WRAPPERS_H -/* We need a number of different prototypes for our - non-existant fuctions */ -char * __unsafe_string_function_usage_here__(void); - -size_t __unsafe_string_function_usage_here_size_t__(void); - -#ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS - -/* if the compiler will optimize out function calls, then use this to tell if we are - have the correct types (this works only where sizeof() returns the size of the buffer, not - the size of the pointer). */ - -#define CHECK_STRING_SIZE(d, len) (sizeof(d) != (len) && sizeof(d) != sizeof(char *)) - -#else /* HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS */ - -#endif /* HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS */ - #define strlcpy_base(dest, src, base, size) \ do { \ const char *_strlcpy_base_src = (const char *)src; \ @@ -74,6 +56,14 @@ do { \ #ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS +/* We need a number of different prototypes for our + non-existant fuctions */ +char * __unsafe_string_function_usage_here__(void); + +size_t __unsafe_string_function_usage_here_size_t__(void); + +#define CHECK_STRING_SIZE(d, len) (sizeof(d) != (len) && sizeof(d) != sizeof(char *)) + /* if the compiler will optimize out function calls, then use this to tell if we are have the correct types (this works only where sizeof() returns the size of the buffer, not the size of the pointer). */ |