提交 030b452b 编写于 作者: R Rich Felker

fix missing _BSD_SOURCE support in bits/*.h

this is actually rather ugly, and would get even uglier if we ever
want to support further feature test macros. at some point i may
factor the bits headers into separate files for C base, POSIX base,
and nonstandard extensions (the only distinctions that seem to matter
now) and then the logic for which to include can go in the main header
rather than being duplicated for each arch. the downside of this is
that it would result in more files having to be opened during
compilation, so as long as the ugliness does not grow, i'm inclined to
leave it alone for now.
上级 96601e3c
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PAGE_SIZE 4096
#define LONG_BIT 32
#endif
......
......@@ -30,7 +30,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
#ifdef _GNU_SOURCE
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
#define MADV_RANDOM 1
#define MADV_SEQUENTIAL 2
......
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef struct {
unsigned long __regs[21];
......@@ -23,7 +23,7 @@ typedef struct __ucontext {
#define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#ifdef _GNU_SOURCE
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
struct sigcontext
{
unsigned long trap_no, error_code, oldmask;
......
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PAGE_SIZE 4096
#define LONG_BIT 32
#endif
......
......@@ -30,7 +30,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
#ifdef _GNU_SOURCE
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
#define MADV_RANDOM 1
#define MADV_SEQUENTIAL 2
......
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
struct __fpstate {
unsigned long __x[7];
......@@ -31,7 +31,7 @@ typedef struct __ucontext {
#define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#ifdef _GNU_SOURCE
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
struct sigcontext {
unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh;
unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax;
......
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PAGE_SIZE 4096
#define LONG_BIT 64
#endif
......
......@@ -30,7 +30,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
#ifdef _GNU_SOURCE
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
#define MADV_RANDOM 1
#define MADV_SEQUENTIAL 2
......
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
struct __fpstate {
unsigned long __x[4];
......@@ -31,7 +31,7 @@ typedef struct __ucontext {
#define SA_RESETHAND 0x80000000
#define SA_RESTORER 0x04000000
#ifdef _GNU_SOURCE
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
struct sigcontext {
unsigned long r8, r9, r10, r11, r12, r13, r14, r15;
unsigned long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册