[PATCH] D16507: [AIX] Add missing code to allow compilation on AIX
Kai Nacke via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 23 06:46:19 PST 2016
Kai created this revision.
Kai added a reviewer: chandlerc.
Kai added a subscriber: llvm-commits.
Adds the following code:
- The endian macros are defined in <sys/machine.h>
- The xBSD implementation is used for path handling
http://reviews.llvm.org/D16507
Files:
include/llvm/Support/Host.h
lib/Support/Unix/Path.inc
Index: lib/Support/Unix/Path.inc
===================================================================
--- lib/Support/Unix/Path.inc
+++ lib/Support/Unix/Path.inc
@@ -67,7 +67,8 @@
namespace fs {
#if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__) || \
- defined(__linux__) || defined(__CYGWIN__) || defined(__DragonFly__)
+ defined(__linux__) || defined(__CYGWIN__) || defined(__DragonFly__)|| \
+ defined(_AIX)
static int
test_dir(char ret[PATH_MAX], const char *dir, const char *bin)
{
@@ -138,7 +139,7 @@
}
#elif defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
defined(__OpenBSD__) || defined(__minix) || defined(__DragonFly__) || \
- defined(__FreeBSD_kernel__)
+ defined(__FreeBSD_kernel__) || defined(_AIX)
char exe_path[PATH_MAX];
if (getprogpath(exe_path, argv0) != NULL)
Index: include/llvm/Support/Host.h
===================================================================
--- include/llvm/Support/Host.h
+++ include/llvm/Support/Host.h
@@ -18,6 +18,8 @@
#if defined(__linux__) || defined(__GNU__)
#include <endian.h>
+#elif defined(_AIX)
+#include <sys/machine.h>
#else
#if !defined(BYTE_ORDER) && !defined(LLVM_ON_WIN32)
#include <machine/endian.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16507.45791.patch
Type: text/x-patch
Size: 1339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160123/3fbd6914/attachment.bin>
More information about the llvm-commits
mailing list