]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Support building ccache with xlclang++ on AIX 7.2 (#805)
authorJon Petrissans <jon.petrissans@protonmail.com>
Wed, 24 Feb 2021 19:13:19 +0000 (21:13 +0200)
committerGitHub <noreply@github.com>
Wed, 24 Feb 2021 19:13:19 +0000 (20:13 +0100)
- Update of config.h.in to build with xlclang++ on AIX 7.2
- Little fixes in code chunks never built on usual platforms

cmake/config.h.in
src/ccache.cpp
src/system.hpp
unittest/test_Util.cpp

index b4e412f7f07f5dcb2e0f4de227bbd3c99e753b4b..d10e16417f8f05bb42f8fb05897ee3c7c300dcf3 100644 (file)
@@ -34,6 +34,9 @@
 #  define _XOPEN_SOURCE 500
 #elif defined(__FreeBSD__)
 #  define _XOPEN_SOURCE 700
+#elif defined(__ibmxl__) && defined(__clang__) // Compiler xlclang
+#  define _XOPEN_SOURCE 600
+#  define _ALL_SOURCE 1
 #elif !defined(__SunOS_5_11) && !defined(__APPLE__)
 #  define _XOPEN_SOURCE
 #endif
 
 // Define if you have the "PTHREAD_MUTEX_ROBUST" constant.
 #cmakedefine HAVE_PTHREAD_MUTEX_ROBUST
+
+#if defined(__ibmxl__) && defined(__clang__) // Compiler xlclang
+#  undef HAVE_VARARGS_H // varargs.h would hide macros of stdarg.h
+#  undef HAVE_STRUCT_STAT_ST_CTIM
+#  undef HAVE_STRUCT_STAT_ST_MTIM
+#endif
index 1183ef9d8e8aa5474692bd7bbecb142647076d31..ae47b2f33076af83f97d64abd1b0dd7671562793 100644 (file)
@@ -64,7 +64,9 @@
 #elif defined(_WIN32)
 #  include "third_party/win32/getopt.h"
 #else
+extern "C" {
 #  include "third_party/getopt_long.h"
+}
 #endif
 
 #ifdef _WIN32
index ae4ca521e4b674b8e905fb887f19a3846c06f4df..a9420e74c7051b01918dc20f7dc77ad1dcc401fe 100644 (file)
@@ -80,7 +80,7 @@
 // function is available in libc.a. This extern define ensures that it is
 // usable within the ccache code base.
 #ifdef _AIX
-extern int usleep(useconds_t);
+extern "C" int usleep(useconds_t);
 #endif
 
 #define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
index 5fd52399d7a7e54fc7258273dbf039b4263d463d..56d4368f70add4c605f632ace5dfd4224abd69d0 100644 (file)
@@ -1080,6 +1080,8 @@ TEST_CASE("Util::wipe_path")
   {
 #ifdef _WIN32
     const char error[] = "failed to rmdir .: Permission denied";
+#elif defined(_AIX)
+    const char error[] = "failed to rmdir .: Device busy";
 #else
     const char error[] = "failed to rmdir .: Invalid argument";
 #endif