Przeglądaj źródła

improve ua_util.h

Julius Pfrommer 9 lat temu
rodzic
commit
68252e5dd7
2 zmienionych plików z 6 dodań i 19 usunięć
  1. 4 0
      include/ua_config.h.in
  2. 2 19
      src/ua_util.h

+ 4 - 0
include/ua_config.h.in

@@ -1,6 +1,10 @@
 #ifndef UA_CONFIG_H_
 #define UA_CONFIG_H_
 
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 500
+#endif
+
 #define UA_LOGLEVEL ${UA_LOGLEVEL}
 #cmakedefine UA_MULTITHREADING
 

+ 2 - 19
src/ua_util.h

@@ -5,22 +5,6 @@
 # include "ua_config.h"
 #endif
 
-#ifndef __USE_POSIX
-# define __USE_POSIX
-#endif
-#ifndef _POSIX_SOURCE
-# define _POSIX_SOURCE
-#endif
-#ifndef _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 199309L
-#endif
-#ifndef _BSD_SOURCE
-# define _BSD_SOURCE
-#endif
-#ifndef _DEFAULT_SOURCE
-# define _DEFAULT_SOURCE
-#endif
-
 /*********************/
 /* Memory Management */
 /*********************/
@@ -66,11 +50,10 @@
 #define UA_memset(ptr, value, size) memset(ptr, value, size)
 
 #ifndef NO_ALLOCA
-# ifdef _WIN32
-#  define UA_alloca(SIZE) _alloca(SIZE)
-# endif
 # ifdef __GNUC__
 #  define UA_alloca(size) __builtin_alloca (size)
+# elif defined(_WIN32)
+#  define UA_alloca(SIZE) _alloca(SIZE)
 # else
 #  include <alloca.h>
 #  define UA_alloca(SIZE) alloca(SIZE)