mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-07 10:54:01 +00:00
[libc] Correct usage of __unix__ and __linux__
Reviewed By: michaelrj, thesamesam Differential Revision: https://reviews.llvm.org/D153729
This commit is contained in:
parent
3878564712
commit
cae84d8acf
@ -1,7 +1,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_FCNTL_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_FCNTL_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/fcntl-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_SCHED_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_SCHED_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/sched-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_SYS_IOCTL_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_SYS_IOCTL_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/sys-ioctl-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_SYS_MMAN_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/sys-mman-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_SYS_RANDOM_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_SYS_RANDOM_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/sys-random-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_SYS_RESOURCE_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_SYS_RESOURCE_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/sys-resource-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_SYS_SOCKET_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_SYS_SOCKET_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/sys-socket-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_SYS_STAT_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_SYS_STAT_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/sys-stat-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_SYS_TIME_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_SYS_TIME_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/sys-time-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_TIME_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_TIME_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/time-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef __LLVM_LIBC_MACROS_UNISTD_MACROS_H
|
||||
#define __LLVM_LIBC_MACROS_UNISTD_MACROS_H
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#include "linux/unistd-macros.h"
|
||||
#endif
|
||||
|
||||
|
@ -19,7 +19,7 @@ typedef struct {
|
||||
void *__owner;
|
||||
unsigned long long __lock_count;
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
__futex_word __ftxw;
|
||||
#else
|
||||
#error "Mutex type not defined for the target platform."
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include <llvm-libc-types/__futex_word.h>
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
typedef __futex_word once_flag;
|
||||
#else
|
||||
#error "Once flag type not defined for the target platform."
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include <llvm-libc-types/__futex_word.h>
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
typedef __futex_word pthread_once_t;
|
||||
#else
|
||||
#error "Once flag type not defined for the target platform."
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
struct dirent {
|
||||
ino_t d_ino;
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
off_t d_off;
|
||||
unsigned short d_reclen;
|
||||
#endif
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef __LLVM_LIBC_TYPES_STRUCT_UTSNAME_H__
|
||||
#define __LLVM_LIBC_TYPES_STRUCT_UTSNAME_H__
|
||||
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
#define __UTS_NAME_LENGTH 65
|
||||
#else
|
||||
// Arbitray default. Should be specialized for each platform.
|
||||
@ -22,7 +22,7 @@ struct utsname {
|
||||
char release[__UTS_NAME_LENGTH];
|
||||
char version[__UTS_NAME_LENGTH];
|
||||
char machine[__UTS_NAME_LENGTH];
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
char domainname[__UTS_NAME_LENGTH];
|
||||
#endif
|
||||
};
|
||||
|
@ -39,7 +39,7 @@ ErrorOr<struct ::dirent *> Dir::read() {
|
||||
return nullptr;
|
||||
|
||||
struct ::dirent *d = reinterpret_cast<struct ::dirent *>(buffer + readptr);
|
||||
#ifdef __unix__
|
||||
#ifdef __linux__
|
||||
// The d_reclen field is available on Linux but not required by POSIX.
|
||||
readptr += d->d_reclen;
|
||||
#else
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "gpu/io.h"
|
||||
#elif defined(__APPLE__)
|
||||
#include "darwin/io.h"
|
||||
#elif defined(__unix__)
|
||||
#elif defined(__linux__)
|
||||
#include "linux/io.h"
|
||||
#elif defined(__Fuchsia__)
|
||||
#include "fuchsia/io.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "gpu/quick_exit.h"
|
||||
#elif defined(__APPLE__)
|
||||
#include "darwin/quick_exit.h"
|
||||
#elif defined(__unix__)
|
||||
#elif defined(__linux__)
|
||||
#include "linux/quick_exit.h"
|
||||
#endif
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "darwin/syscall.h"
|
||||
#elif defined(__unix__)
|
||||
#elif defined(__linux__)
|
||||
#include "linux/syscall.h"
|
||||
#endif
|
||||
|
||||
|
@ -37,11 +37,11 @@
|
||||
// few global locks. So, to avoid static initialization order fiasco, we
|
||||
// want the constructors of the Mutex classes to be constexprs.
|
||||
|
||||
#if defined(__unix__)
|
||||
#if defined(__linux__)
|
||||
#include "linux/mutex.h"
|
||||
#elif defined(LIBC_TARGET_ARCH_IS_GPU)
|
||||
#include "gpu/mutex.h"
|
||||
#endif // __unix__
|
||||
#endif // __linux__
|
||||
|
||||
namespace __llvm_libc {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user