lib/util/string_wrappers: move everything into one HAVE_COMPILER_WILL_OPTIMIZE_OUT_FN...
authorStefan Metzmacher <metze@samba.org>
Fri, 24 Jun 2011 19:49:16 +0000 (21:49 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 30 Jun 2011 12:29:41 +0000 (14:29 +0200)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jun 30 14:29:41 CEST 2011 on sn-devel-104

lib/util/string_wrappers.h

index 37384fc5a3224ce06ac3c9b3fab3becd75b55e11..6f2d6e91228fccd81d9c51f1b6971d5011e1da44 100644 (file)
 #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). */