#At file:///Users/jimw/my/libmysql-1.0/ based on revid:jimw@stripped
2793 Jim Winstead 2008-12-16
Add tests for socklen_t and 'inline' in C code
modified:
CMakePlatformTests.txt
include/my_config.h.in
=== modified file 'CMakePlatformTests.txt'
--- a/CMakePlatformTests.txt 2008-12-15 20:31:53 +0000
+++ b/CMakePlatformTests.txt 2008-12-16 19:04:48 +0000
@@ -226,6 +226,10 @@ CHECK_TYPE_SIZE(uint32 SIZEOF_UINT32)
CHECK_TYPE_SIZE(u_int32_t SIZEOF_UINT_32_T)
CHECK_TYPE_SIZE(int64 SIZEOF_INT64)
CHECK_TYPE_SIZE(uint64 SIZEOF_UINT64)
+IF(HAVE_SYS_SOCKET_H)
+ SET(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
+ENDIF(HAVE_SYS_SOCKET_H)
+CHECK_TYPE_SIZE(socklen_t SIZEOF_SOCKLEN_T)
SET(CMAKE_EXTRA_INCLUDE_FILES)
#
@@ -303,3 +307,21 @@ CHECK_C_SOURCE_COMPILES("#include <math.
HAVE_ISNAN)
SET(CMAKE_REQUIRED_LIBRARIES "")
+#
+# Test for how the C compiler does inline, if at all
+#
+FOREACH(KEYWORD "inline" "__inline__" "__inline")
+ IF(NOT DEFINED C_INLINE)
+ CHECK_C_SOURCE_COMPILES("typedef int foo_t;
+static inline foo_t static_foo(){return 0;}
+foo_t foo(){return 0;}
+int main(int argc, char *argv[]){return 0;}"
+ C_HAS_${KEYWORD})
+ IF(C_HAS_${KEYWORD})
+ SET(C_INLINE ${KEYWORD})
+ ENDIF(C_HAS_${KEYWORD})
+ ENDIF(NOT DEFINED C_INLINE)
+ENDFOREACH(KEYWORD)
+IF(NOT DEFINED C_INLINE)
+ SET(C_INLINE "")
+ENDIF(NOT DEFINED C_INLINE)
=== modified file 'include/my_config.h.in'
--- a/include/my_config.h.in 2008-12-15 22:18:29 +0000
+++ b/include/my_config.h.in 2008-12-16 19:04:48 +0000
@@ -261,6 +261,11 @@
# define HAVE_UINT64 1
#endif
+#cmakedefine SIZEOF_SOCKLEN_T @SIZEOF_SOCKLEN_T@
+#if SIZEOF_SOCKLEN_T
+# define HAVE_SOCKLEN_T 1
+#endif
+
/* XXX mysql_client_test uses this -- rip it out, please! */
#define MAX_INDEXES 64
@@ -270,6 +275,12 @@
#cmakedefine SIGNAL_RETURN_TYPE_IS_VOID 1
#define RETSIGTYPE @RETSIGTYPE@
+/* Define to `__inline__' or `__inline' if that's what the C compiler calls
+ it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+# define inline @C_INLINE@
+#endif
+
#define TIME_WITH_SYS_TIME 1
#define STACK_DIRECTION -1
| Thread |
|---|
| • bzr commit into libmysql branch (jimw:2793) | Jim Winstead | 16 Dec |