Browse Source

libuv: Compile as C11 on all Solaris versions

Using `_XOPEN_SOURCE=600` on Solaris 5.10, as we do on Solaris 5.11+
already, allows the system headers to be included in C99 and C11 modes.
Brad King 2 years ago
parent
commit
eee1dc10be
2 changed files with 5 additions and 13 deletions
  1. 5 11
      Utilities/cmlibuv/CMakeLists.txt
  2. 0 2
      bootstrap

+ 5 - 11
Utilities/cmlibuv/CMakeLists.txt

@@ -294,19 +294,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
     )
   list(APPEND uv_defines
     __EXTENSIONS__
+    _XOPEN_SOURCE=600
     )
+  if(NOT CMAKE_C_STANDARD OR CMAKE_C_STANDARD EQUAL 90)
+    set(CMAKE_C_STANDARD 11)
+  endif()
   if(CMAKE_SYSTEM_VERSION STREQUAL "5.10")
-    set(CMAKE_C_STANDARD 90)
-    list(APPEND uv_defines
-      _XOPEN_SOURCE=500
-      )
-  else()
-    if(NOT CMAKE_C_STANDARD OR CMAKE_C_STANDARD EQUAL 90)
-      set(CMAKE_C_STANDARD 11)
-    endif()
-    list(APPEND uv_defines
-      _XOPEN_SOURCE=600
-      )
+    list(APPEND uv_defines SUNOS_NO_IFADDRS)
   endif()
   list(APPEND uv_sources
     src/unix/no-proctitle.c

+ 0 - 2
bootstrap

@@ -1762,8 +1762,6 @@ else
       libs="${libs} -lkvm"
       ;;
     *SunOS*)
-      # Normally libuv uses '-D_XOPEN_SOURCE=500 -std=c90' on Solaris 5.10,
-      # but we do not need to do that because we bootstrap using POSIX APIs.
       uv_c_flags="${uv_c_flags} -D__EXTENSIONS__ -D_XOPEN_SOURCE=600"
       libs="${libs} -lkstat -lnsl -lsendfile -lsocket -lrt"
       ;;