From 15684250225252a6ef74a7c3779294ca5aa0c16c Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Wed, 28 Nov 2018 21:53:06 +0000 Subject: [PATCH] libphobos: Merge common version blocks using arch_any conditions This sets a precedence in upstream for merging architecture agnostic C bindings into one block, rather than separate duplicated blocks. A nice side-effect is it almost completes the C bindings for s390-linux-gnu and sparc-linux-gnu, and fixes a bug on MIPS32 where O_SYNC had the wrong value. Backported from upstream druntime master. Reviewed-on: https://github.com/dlang/druntime/pull/2357 From-SVN: r266593 --- libphobos/libdruntime/core/stdc/errno.d | 545 +----------------- libphobos/libdruntime/core/stdc/fenv.d | 116 +--- libphobos/libdruntime/core/stdc/math.d | 53 +- libphobos/libdruntime/core/sys/linux/dlfcn.d | 121 +--- libphobos/libdruntime/core/sys/linux/epoll.d | 58 +- libphobos/libdruntime/core/sys/linux/link.d | 45 +- .../libdruntime/core/sys/linux/sys/auxv.d | 89 +-- .../libdruntime/core/sys/linux/sys/eventfd.d | 49 +- .../libdruntime/core/sys/linux/sys/inotify.d | 45 +- .../libdruntime/core/sys/linux/sys/mman.d | 250 +------- libphobos/libdruntime/core/sys/posix/dlfcn.d | 53 +- libphobos/libdruntime/core/sys/posix/fcntl.d | 77 +-- libphobos/libdruntime/core/sys/posix/signal.d | 173 +----- .../libdruntime/core/sys/posix/sys/mman.d | 69 +-- .../libdruntime/core/sys/posix/sys/socket.d | 163 +----- 15 files changed, 294 insertions(+), 1612 deletions(-) diff --git a/libphobos/libdruntime/core/stdc/errno.d b/libphobos/libdruntime/core/stdc/errno.d index 8f9b64a2dce..eaf4867a942 100644 --- a/libphobos/libdruntime/core/stdc/errno.d +++ b/libphobos/libdruntime/core/stdc/errno.d @@ -23,6 +23,21 @@ else version (TVOS) else version (WatchOS) version = Darwin; +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (RISCV32) version = RISCV_Any; +version (RISCV64) version = RISCV_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + @trusted: // Only manipulates errno. nothrow: @nogc: @@ -200,213 +215,7 @@ else version (linux) enum EDOM = 33; /// enum ERANGE = 34; /// - version (X86) - { - enum EDEADLK = 35; /// - enum ENAMETOOLONG = 36; /// - enum ENOLCK = 37; /// - enum ENOSYS = 38; /// - enum ENOTEMPTY = 39; /// - enum ELOOP = 40; /// - enum EWOULDBLOCK = EAGAIN; /// - enum ENOMSG = 42; /// - enum EIDRM = 43; /// - enum ECHRNG = 44; /// - enum EL2NSYNC = 45; /// - enum EL3HLT = 46; /// - enum EL3RST = 47; /// - enum ELNRNG = 48; /// - enum EUNATCH = 49; /// - enum ENOCSI = 50; /// - enum EL2HLT = 51; /// - enum EBADE = 52; /// - enum EBADR = 53; /// - enum EXFULL = 54; /// - enum ENOANO = 55; /// - enum EBADRQC = 56; /// - enum EBADSLT = 57; /// - enum EDEADLOCK = EDEADLK; /// - enum EBFONT = 59; /// - enum ENOSTR = 60; /// - enum ENODATA = 61; /// - enum ETIME = 62; /// - enum ENOSR = 63; /// - enum ENONET = 64; /// - enum ENOPKG = 65; /// - enum EREMOTE = 66; /// - enum ENOLINK = 67; /// - enum EADV = 68; /// - enum ESRMNT = 69; /// - enum ECOMM = 70; /// - enum EPROTO = 71; /// - enum EMULTIHOP = 72; /// - enum EDOTDOT = 73; /// - enum EBADMSG = 74; /// - enum EOVERFLOW = 75; /// - enum ENOTUNIQ = 76; /// - enum EBADFD = 77; /// - enum EREMCHG = 78; /// - enum ELIBACC = 79; /// - enum ELIBBAD = 80; /// - enum ELIBSCN = 81; /// - enum ELIBMAX = 82; /// - enum ELIBEXEC = 83; /// - enum EILSEQ = 84; /// - enum ERESTART = 85; /// - enum ESTRPIPE = 86; /// - enum EUSERS = 87; /// - enum ENOTSOCK = 88; /// - enum EDESTADDRREQ = 89; /// - enum EMSGSIZE = 90; /// - enum EPROTOTYPE = 91; /// - enum ENOPROTOOPT = 92; /// - enum EPROTONOSUPPORT = 93; /// - enum ESOCKTNOSUPPORT = 94; /// - enum EOPNOTSUPP = 95; /// - enum ENOTSUP = EOPNOTSUPP; /// - enum EPFNOSUPPORT = 96; /// - enum EAFNOSUPPORT = 97; /// - enum EADDRINUSE = 98; /// - enum EADDRNOTAVAIL = 99; /// - enum ENETDOWN = 100; /// - enum ENETUNREACH = 101; /// - enum ENETRESET = 102; /// - enum ECONNABORTED = 103; /// - enum ECONNRESET = 104; /// - enum ENOBUFS = 105; /// - enum EISCONN = 106; /// - enum ENOTCONN = 107; /// - enum ESHUTDOWN = 108; /// - enum ETOOMANYREFS = 109; /// - enum ETIMEDOUT = 110; /// - enum ECONNREFUSED = 111; /// - enum EHOSTDOWN = 112; /// - enum EHOSTUNREACH = 113; /// - enum EALREADY = 114; /// - enum EINPROGRESS = 115; /// - enum ESTALE = 116; /// - enum EUCLEAN = 117; /// - enum ENOTNAM = 118; /// - enum ENAVAIL = 119; /// - enum EISNAM = 120; /// - enum EREMOTEIO = 121; /// - enum EDQUOT = 122; /// - enum ENOMEDIUM = 123; /// - enum EMEDIUMTYPE = 124; /// - enum ECANCELED = 125; /// - enum ENOKEY = 126; /// - enum EKEYEXPIRED = 127; /// - enum EKEYREVOKED = 128; /// - enum EKEYREJECTED = 129; /// - enum EOWNERDEAD = 130; /// - enum ENOTRECOVERABLE = 131; /// - enum ERFKILL = 132; /// - enum EHWPOISON = 133; /// - } - else version (X86_64) - { - enum EDEADLK = 35; /// - enum ENAMETOOLONG = 36; /// - enum ENOLCK = 37; /// - enum ENOSYS = 38; /// - enum ENOTEMPTY = 39; /// - enum ELOOP = 40; /// - enum EWOULDBLOCK = EAGAIN; /// - enum ENOMSG = 42; /// - enum EIDRM = 43; /// - enum ECHRNG = 44; /// - enum EL2NSYNC = 45; /// - enum EL3HLT = 46; /// - enum EL3RST = 47; /// - enum ELNRNG = 48; /// - enum EUNATCH = 49; /// - enum ENOCSI = 50; /// - enum EL2HLT = 51; /// - enum EBADE = 52; /// - enum EBADR = 53; /// - enum EXFULL = 54; /// - enum ENOANO = 55; /// - enum EBADRQC = 56; /// - enum EBADSLT = 57; /// - enum EDEADLOCK = EDEADLK; /// - enum EBFONT = 59; /// - enum ENOSTR = 60; /// - enum ENODATA = 61; /// - enum ETIME = 62; /// - enum ENOSR = 63; /// - enum ENONET = 64; /// - enum ENOPKG = 65; /// - enum EREMOTE = 66; /// - enum ENOLINK = 67; /// - enum EADV = 68; /// - enum ESRMNT = 69; /// - enum ECOMM = 70; /// - enum EPROTO = 71; /// - enum EMULTIHOP = 72; /// - enum EDOTDOT = 73; /// - enum EBADMSG = 74; /// - enum EOVERFLOW = 75; /// - enum ENOTUNIQ = 76; /// - enum EBADFD = 77; /// - enum EREMCHG = 78; /// - enum ELIBACC = 79; /// - enum ELIBBAD = 80; /// - enum ELIBSCN = 81; /// - enum ELIBMAX = 82; /// - enum ELIBEXEC = 83; /// - enum EILSEQ = 84; /// - enum ERESTART = 85; /// - enum ESTRPIPE = 86; /// - enum EUSERS = 87; /// - enum ENOTSOCK = 88; /// - enum EDESTADDRREQ = 89; /// - enum EMSGSIZE = 90; /// - enum EPROTOTYPE = 91; /// - enum ENOPROTOOPT = 92; /// - enum EPROTONOSUPPORT = 93; /// - enum ESOCKTNOSUPPORT = 94; /// - enum EOPNOTSUPP = 95; /// - enum ENOTSUP = EOPNOTSUPP; /// - enum EPFNOSUPPORT = 96; /// - enum EAFNOSUPPORT = 97; /// - enum EADDRINUSE = 98; /// - enum EADDRNOTAVAIL = 99; /// - enum ENETDOWN = 100; /// - enum ENETUNREACH = 101; /// - enum ENETRESET = 102; /// - enum ECONNABORTED = 103; /// - enum ECONNRESET = 104; /// - enum ENOBUFS = 105; /// - enum EISCONN = 106; /// - enum ENOTCONN = 107; /// - enum ESHUTDOWN = 108; /// - enum ETOOMANYREFS = 109; /// - enum ETIMEDOUT = 110; /// - enum ECONNREFUSED = 111; /// - enum EHOSTDOWN = 112; /// - enum EHOSTUNREACH = 113; /// - enum EALREADY = 114; /// - enum EINPROGRESS = 115; /// - enum ESTALE = 116; /// - enum EUCLEAN = 117; /// - enum ENOTNAM = 118; /// - enum ENAVAIL = 119; /// - enum EISNAM = 120; /// - enum EREMOTEIO = 121; /// - enum EDQUOT = 122; /// - enum ENOMEDIUM = 123; /// - enum EMEDIUMTYPE = 124; /// - enum ECANCELED = 125; /// - enum ENOKEY = 126; /// - enum EKEYEXPIRED = 127; /// - enum EKEYREVOKED = 128; /// - enum EKEYREJECTED = 129; /// - enum EOWNERDEAD = 130; /// - enum ENOTRECOVERABLE = 131; /// - enum ERFKILL = 132; /// - enum EHWPOISON = 133; /// - } - else version (ARM) + version (X86_Any) { enum EDEADLK = 35; /// enum ENAMETOOLONG = 36; /// @@ -509,7 +318,7 @@ else version (linux) enum ERFKILL = 132; /// enum EHWPOISON = 133; /// } - else version (AArch64) + else version (ARM_Any) { enum EDEADLK = 35; /// enum ENAMETOOLONG = 36; /// @@ -612,112 +421,7 @@ else version (linux) enum ERFKILL = 132; /// enum EHWPOISON = 133; /// } - else version (MIPS32) - { - enum ENOMSG = 35; /// - enum EIDRM = 36; /// - enum ECHRNG = 37; /// - enum EL2NSYNC = 38; /// - enum EL3HLT = 39; /// - enum EL3RST = 40; /// - enum ELNRNG = 41; /// - enum EUNATCH = 42; /// - enum ENOCSI = 43; /// - enum EL2HLT = 44; /// - enum EDEADLK = 45; /// - enum ENOLCK = 46; /// - enum EBADE = 50; /// - enum EBADR = 51; /// - enum EXFULL = 52; /// - enum ENOANO = 53; /// - enum EBADRQC = 54; /// - enum EBADSLT = 55; /// - enum EDEADLOCK = 56; /// - enum EBFONT = 59; /// - enum ENOSTR = 60; /// - enum ENODATA = 61; /// - enum ETIME = 62; /// - enum ENOSR = 63; /// - enum ENONET = 64; /// - enum ENOPKG = 65; /// - enum EREMOTE = 66; /// - enum ENOLINK = 67; /// - enum EADV = 68; /// - enum ESRMNT = 69; /// - enum ECOMM = 70; /// - enum EPROTO = 71; /// - enum EDOTDOT = 73; /// - enum EMULTIHOP = 74; /// - enum EBADMSG = 77; /// - enum ENAMETOOLONG = 78; /// - enum EOVERFLOW = 79; /// - enum ENOTUNIQ = 80; /// - enum EBADFD = 81; /// - enum EREMCHG = 82; /// - enum ELIBACC = 83; /// - enum ELIBBAD = 84; /// - enum ELIBSCN = 85; /// - enum ELIBMAX = 86; /// - enum ELIBEXEC = 87; /// - enum EILSEQ = 88; /// - enum ENOSYS = 89; /// - enum ELOOP = 90; /// - enum ERESTART = 91; /// - enum ESTRPIPE = 92; /// - enum ENOTEMPTY = 93; /// - enum EUSERS = 94; /// - enum ENOTSOCK = 95; /// - enum EDESTADDRREQ = 96; /// - enum EMSGSIZE = 97; /// - enum EPROTOTYPE = 98; /// - enum ENOPROTOOPT = 99; /// - enum EPROTONOSUPPORT = 120; /// - enum ESOCKTNOSUPPORT = 121; /// - enum EOPNOTSUPP = 122; /// - enum ENOTSUP = EOPNOTSUPP; /// - enum EPFNOSUPPORT = 123; /// - enum EAFNOSUPPORT = 124; /// - enum EADDRINUSE = 125; /// - enum EADDRNOTAVAIL = 126; /// - enum ENETDOWN = 127; /// - enum ENETUNREACH = 128; /// - enum ENETRESET = 129; /// - enum ECONNABORTED = 130; /// - enum ECONNRESET = 131; /// - enum ENOBUFS = 132; /// - enum EISCONN = 133; /// - enum ENOTCONN = 134; /// - enum EUCLEAN = 135; /// - enum ENOTNAM = 137; /// - enum ENAVAIL = 138; /// - enum EISNAM = 139; /// - enum EREMOTEIO = 140; /// - enum EINIT = 141; /// - enum EREMDEV = 142; /// - enum ESHUTDOWN = 143; /// - enum ETOOMANYREFS = 144; /// - enum ETIMEDOUT = 145; /// - enum ECONNREFUSED = 146; /// - enum EHOSTDOWN = 147; /// - enum EHOSTUNREACH = 148; /// - enum EWOULDBLOCK = EAGAIN; /// - enum EALREADY = 149; /// - enum EINPROGRESS = 150; /// - enum ESTALE = 151; /// - enum ECANCELED = 158; /// - enum ENOMEDIUM = 159; /// - enum EMEDIUMTYPE = 160; /// - enum ENOKEY = 161; /// - enum EKEYEXPIRED = 162; /// - enum EKEYREVOKED = 163; /// - enum EKEYREJECTED = 164; /// - enum EOWNERDEAD = 165; /// - enum ENOTRECOVERABLE = 166; /// - enum ERFKILL = 167; /// - enum EHWPOISON = 168; /// - enum EDQUOT = 1133; /// - } - else version (MIPS64) + else version (MIPS_Any) { enum ENOMSG = 35; /// enum EIDRM = 36; /// @@ -822,110 +526,7 @@ else version (linux) enum EHWPOISON = 168; /// enum EDQUOT = 1133; /// } - else version (PPC) - { - enum EDEADLK = 35; /// - enum ENAMETOOLONG = 36; /// - enum ENOLCK = 37; /// - enum ENOSYS = 38; /// - enum ENOTEMPTY = 39; /// - enum ELOOP = 40; /// - enum EWOULDBLOCK = EAGAIN; /// - enum ENOMSG = 42; /// - enum EIDRM = 43; /// - enum ECHRNG = 44; /// - enum EL2NSYNC = 45; /// - enum EL3HLT = 46; /// - enum EL3RST = 47; /// - enum ELNRNG = 48; /// - enum EUNATCH = 49; /// - enum ENOCSI = 50; /// - enum EL2HLT = 51; /// - enum EBADE = 52; /// - enum EBADR = 53; /// - enum EXFULL = 54; /// - enum ENOANO = 55; /// - enum EBADRQC = 56; /// - enum EBADSLT = 57; /// - enum EDEADLOCK = 58; /// - enum EBFONT = 59; /// - enum ENOSTR = 60; /// - enum ENODATA = 61; /// - enum ETIME = 62; /// - enum ENOSR = 63; /// - enum ENONET = 64; /// - enum ENOPKG = 65; /// - enum EREMOTE = 66; /// - enum ENOLINK = 67; /// - enum EADV = 68; /// - enum ESRMNT = 69; /// - enum ECOMM = 70; /// - enum EPROTO = 71; /// - enum EMULTIHOP = 72; /// - enum EDOTDOT = 73; /// - enum EBADMSG = 74; /// - enum EOVERFLOW = 75; /// - enum ENOTUNIQ = 76; /// - enum EBADFD = 77; /// - enum EREMCHG = 78; /// - enum ELIBACC = 79; /// - enum ELIBBAD = 80; /// - enum ELIBSCN = 81; /// - enum ELIBMAX = 82; /// - enum ELIBEXEC = 83; /// - enum EILSEQ = 84; /// - enum ERESTART = 85; /// - enum ESTRPIPE = 86; /// - enum EUSERS = 87; /// - enum ENOTSOCK = 88; /// - enum EDESTADDRREQ = 89; /// - enum EMSGSIZE = 90; /// - enum EPROTOTYPE = 91; /// - enum ENOPROTOOPT = 92; /// - enum EPROTONOSUPPORT = 93; /// - enum ESOCKTNOSUPPORT = 94; /// - enum EOPNOTSUPP = 95; /// - enum ENOTSUP = EOPNOTSUPP; /// - enum EPFNOSUPPORT = 96; /// - enum EAFNOSUPPORT = 97; /// - enum EADDRINUSE = 98; /// - enum EADDRNOTAVAIL = 99; /// - enum ENETDOWN = 100; /// - enum ENETUNREACH = 101; /// - enum ENETRESET = 102; /// - enum ECONNABORTED = 103; /// - enum ECONNRESET = 104; /// - enum ENOBUFS = 105; /// - enum EISCONN = 106; /// - enum ENOTCONN = 107; /// - enum ESHUTDOWN = 108; /// - enum ETOOMANYREFS = 109; /// - enum ETIMEDOUT = 110; /// - enum ECONNREFUSED = 111; /// - enum EHOSTDOWN = 112; /// - enum EHOSTUNREACH = 113; /// - enum EALREADY = 114; /// - enum EINPROGRESS = 115; /// - enum ESTALE = 116; /// - enum EUCLEAN = 117; /// - enum ENOTNAM = 118; /// - enum ENAVAIL = 119; /// - enum EISNAM = 120; /// - enum EREMOTEIO = 121; /// - enum EDQUOT = 122; /// - enum ENOMEDIUM = 123; /// - enum EMEDIUMTYPE = 124; /// - enum ECANCELED = 125; /// - enum ENOKEY = 126; /// - enum EKEYEXPIRED = 127; /// - enum EKEYREVOKED = 128; /// - enum EKEYREJECTED = 129; /// - enum EOWNERDEAD = 130; /// - enum ENOTRECOVERABLE = 131; /// - enum ERFKILL = 132; /// - enum EHWPOISON = 133; /// - } - else version (PPC64) + else version (PPC_Any) { enum EDEADLK = 35; /// enum ENAMETOOLONG = 36; /// @@ -1028,109 +629,7 @@ else version (linux) enum ERFKILL = 132; /// enum EHWPOISON = 133; /// } - else version (RISCV32) - { - enum EDEADLK = 35; /// - enum ENAMETOOLONG = 36; /// - enum ENOLCK = 37; /// - enum ENOSYS = 38; /// - enum ENOTEMPTY = 39; /// - enum ELOOP = 40; /// - enum EWOULDBLOCK = EAGAIN; /// - enum ENOMSG = 42; /// - enum EIDRM = 43; /// - enum ECHRNG = 44; /// - enum EL2NSYNC = 45; /// - enum EL3HLT = 46; /// - enum EL3RST = 47; /// - enum ELNRNG = 48; /// - enum EUNATCH = 49; /// - enum ENOCSI = 50; /// - enum EL2HLT = 51; /// - enum EBADE = 52; /// - enum EBADR = 53; /// - enum EXFULL = 54; /// - enum ENOANO = 55; /// - enum EBADRQC = 56; /// - enum EBADSLT = 57; /// - enum EDEADLOCK = EDEADLK; /// - enum EBFONT = 59; /// - enum ENOSTR = 60; /// - enum ENODATA = 61; /// - enum ETIME = 62; /// - enum ENOSR = 63; /// - enum ENONET = 64; /// - enum ENOPKG = 65; /// - enum EREMOTE = 66; /// - enum ENOLINK = 67; /// - enum EADV = 68; /// - enum ESRMNT = 69; /// - enum ECOMM = 70; /// - enum EPROTO = 71; /// - enum EMULTIHOP = 72; /// - enum EDOTDOT = 73; /// - enum EBADMSG = 74; /// - enum EOVERFLOW = 75; /// - enum ENOTUNIQ = 76; /// - enum EBADFD = 77; /// - enum EREMCHG = 78; /// - enum ELIBACC = 79; /// - enum ELIBBAD = 80; /// - enum ELIBSCN = 81; /// - enum ELIBMAX = 82; /// - enum ELIBEXEC = 83; /// - enum EILSEQ = 84; /// - enum ERESTART = 85; /// - enum ESTRPIPE = 86; /// - enum EUSERS = 87; /// - enum ENOTSOCK = 88; /// - enum EDESTADDRREQ = 89; /// - enum EMSGSIZE = 90; /// - enum EPROTOTYPE = 91; /// - enum ENOPROTOOPT = 92; /// - enum EPROTONOSUPPORT = 93; /// - enum ESOCKTNOSUPPORT = 94; /// - enum EOPNOTSUPP = 95; /// - enum EPFNOSUPPORT = 96; /// - enum EAFNOSUPPORT = 97; /// - enum EADDRINUSE = 98; /// - enum EADDRNOTAVAIL = 99; /// - enum ENETDOWN = 100; /// - enum ENETUNREACH = 101; /// - enum ENETRESET = 102; /// - enum ECONNABORTED = 103; /// - enum ECONNRESET = 104; /// - enum ENOBUFS = 105; /// - enum EISCONN = 106; /// - enum ENOTCONN = 107; /// - enum ESHUTDOWN = 108; /// - enum ETOOMANYREFS = 109; /// - enum ETIMEDOUT = 110; /// - enum ECONNREFUSED = 111; /// - enum EHOSTDOWN = 112; /// - enum EHOSTUNREACH = 113; /// - enum EALREADY = 114; /// - enum EINPROGRESS = 115; /// - enum ESTALE = 116; /// - enum EUCLEAN = 117; /// - enum ENOTNAM = 118; /// - enum ENAVAIL = 119; /// - enum EISNAM = 120; /// - enum EREMOTEIO = 121; /// - enum EDQUOT = 122; /// - enum ENOMEDIUM = 123; /// - enum EMEDIUMTYPE = 124; /// - enum ECANCELED = 125; /// - enum ENOKEY = 126; /// - enum EKEYEXPIRED = 127; /// - enum EKEYREVOKED = 128; /// - enum EKEYREJECTED = 129; /// - enum EOWNERDEAD = 130; /// - enum ENOTRECOVERABLE = 131; /// - enum ERFKILL = 132; /// - enum EHWPOISON = 133; /// - } - else version (RISCV64) + else version (RISCV_Any) { enum EDEADLK = 35; /// enum ENAMETOOLONG = 36; /// @@ -1232,7 +731,7 @@ else version (linux) enum ERFKILL = 132; /// enum EHWPOISON = 133; /// } - else version (SPARC64) + else version (SPARC_Any) { enum EWOULDBLOCK = EAGAIN; /// enum EINPROGRESS = 36; /// @@ -1337,7 +836,7 @@ else version (linux) enum ERFKILL = 134; /// enum EHWPOISON = 135; /// } - else version (SystemZ) + else version (IBMZ_Any) { enum EDEADLK = 35; /// enum ENAMETOOLONG = 36; /// diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d index bcd6e40d514..3bcbd65009d 100644 --- a/libphobos/libdruntime/core/stdc/fenv.d +++ b/libphobos/libdruntime/core/stdc/fenv.d @@ -28,10 +28,18 @@ extern (C): nothrow: @nogc: -version (PPC) - version = PPC_Any; -else version (PPC64) - version = PPC_Any; +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; version (MinGW) version = GNUFP; @@ -84,17 +92,7 @@ version (GNUFP) alias fexcept_t = ushort; } // https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mips/bits/fenv.h - else version (MIPS32) - { - struct fenv_t - { - uint __fp_control_register; - } - - alias fexcept_t = ushort; - } - // https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mips/bits/fenv.h - else version (MIPS64) + else version (MIPS_Any) { struct fenv_t { @@ -137,7 +135,7 @@ version (GNUFP) alias fexcept_t = ulong; } // https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/s390/fpu/bits/fenv.h - else version (SystemZ) + else version (IBMZ_Any) { struct fenv_t { @@ -499,7 +497,7 @@ else FE_TOWARDZERO = 0xC00, /// } } - else version (ARM) + else version (ARM_Any) { // Define bits representing exceptions in the FPU status word. enum @@ -521,29 +519,7 @@ else FE_TOWARDZERO = 0xC00000, /// } } - else version (AArch64) - { - // Define bits representing exceptions in the FPSR status word. - enum - { - FE_INVALID = 1, /// - FE_DIVBYZERO = 2, /// - FE_OVERFLOW = 4, /// - FE_UNDERFLOW = 8, /// - FE_INEXACT = 16, /// - FE_ALL_EXCEPT = 31, /// - } - - // Define bits representing rounding modes in the FPCR Rmode field. - enum - { - FE_TONEAREST = 0x000000, /// - FE_UPWARD = 0x400000, /// - FE_DOWNWARD = 0x800000, /// - FE_TOWARDZERO = 0xC00000, /// - } - } - else version (MIPS32) + else version (MIPS_Any) { // Define bits representing the exception. enum @@ -565,61 +541,7 @@ else FE_DOWNWARD = 0x3, /// } } - else version (MIPS64) - { - // Define bits representing the exception. - enum - { - FE_INEXACT = 0x04, /// - FE_UNDERFLOW = 0x08, /// - FE_OVERFLOW = 0x10, /// - FE_DIVBYZERO = 0x20, /// - FE_INVALID = 0x40, /// - FE_ALL_EXCEPT = 0x7C, /// - } - - // The MIPS FPU supports all of the four defined rounding modes. - enum - { - FE_TONEAREST = 0x0, /// - FE_TOWARDZERO = 0x1, /// - FE_UPWARD = 0x2, /// - FE_DOWNWARD = 0x3, /// - } - } - else version (PPC) - { - // Define bits representing the exception. - enum - { - FE_INEXACT = 0x2000000, /// - FE_DIVBYZERO = 0x4000000, /// - FE_UNDERFLOW = 0x8000000, /// - FE_OVERFLOW = 0x10000000, /// - FE_INVALID = 0x20000000, /// - FE_INVALID_SNAN = 0x1000000, /// non-standard - FE_INVALID_ISI = 0x800000, /// non-standard - FE_INVALID_IDI = 0x400000, /// non-standard - FE_INVALID_ZDZ = 0x200000, /// non-standard - FE_INVALID_IMZ = 0x100000, /// non-standard - FE_INVALID_COMPARE = 0x80000, /// non-standard - FE_INVALID_SOFTWARE = 0x400, /// non-standard - FE_INVALID_SQRT = 0x200, /// non-standard - FE_INVALID_INTEGER_CONVERSION = 0x100, /// non-standard - FE_ALL_INVALID = 0x1F80700, /// non-standard - FE_ALL_EXCEPT = 0x3E000000, /// - } - - // PowerPC chips support all of the four defined rounding modes. - enum - { - FE_TONEAREST = 0, /// - FE_TOWARDZERO = 1, /// - FE_UPWARD = 2, /// - FE_DOWNWARD = 3, /// - } - } - else version (PPC64) + else version (PPC_Any) { // Define bits representing the exception. enum @@ -651,7 +573,7 @@ else FE_DOWNWARD = 3, /// } } - else version (SPARC64) + else version (SPARC_Any) { // Define bits representing the exception. enum @@ -673,7 +595,7 @@ else FE_DOWNWARD = 0xc0000000, /// } } - else version (SystemZ) + else version (IBMZ_Any) { // Define bits representing the exception. enum diff --git a/libphobos/libdruntime/core/stdc/math.d b/libphobos/libdruntime/core/stdc/math.d index cf6d8821cfd..8052ff7f344 100644 --- a/libphobos/libdruntime/core/stdc/math.d +++ b/libphobos/libdruntime/core/stdc/math.d @@ -24,6 +24,19 @@ else version (TVOS) else version (WatchOS) version = Darwin; +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + extern (C): @trusted: // All functions here operate on floating point and integer values only. nothrow: @@ -118,70 +131,42 @@ else version (CRuntime_UClibc) } else version (CRuntime_Glibc) { - version (X86) + version (X86_Any) { /// enum int FP_ILOGB0 = int.min; /// enum int FP_ILOGBNAN = int.min; } - else version (X86_64) - { - /// - enum int FP_ILOGB0 = int.min; - /// - enum int FP_ILOGBNAN = int.min; - } - else version (ARM) - { - /// - enum int FP_ILOGB0 = -int.max; - /// - enum int FP_ILOGBNAN = int.max; - } - else version (AArch64) - { - /// - enum int FP_ILOGB0 = -int.max; - /// - enum int FP_ILOGBNAN = int.max; - } - else version (MIPS32) - { - /// - enum int FP_ILOGB0 = -int.max; - /// - enum int FP_ILOGBNAN = int.max; - } - else version (MIPS64) + else version (ARM_Any) { /// enum int FP_ILOGB0 = -int.max; /// enum int FP_ILOGBNAN = int.max; } - else version (PPC) + else version (MIPS_Any) { /// enum int FP_ILOGB0 = -int.max; /// enum int FP_ILOGBNAN = int.max; } - else version (PPC64) + else version (PPC_Any) { /// enum int FP_ILOGB0 = -int.max; /// enum int FP_ILOGBNAN = int.max; } - else version (SPARC64) + else version (SPARC_Any) { /// enum int FP_ILOGB0 = -int.max; /// enum int FP_ILOGBNAN = int.max; } - else version (SystemZ) + else version (IBMZ_Any) { /// enum int FP_ILOGB0 = -int.max; diff --git a/libphobos/libdruntime/core/sys/linux/dlfcn.d b/libphobos/libdruntime/core/sys/linux/dlfcn.d index 281ae526b40..26e5b409253 100644 --- a/libphobos/libdruntime/core/sys/linux/dlfcn.d +++ b/libphobos/libdruntime/core/sys/linux/dlfcn.d @@ -10,35 +10,24 @@ extern (C): nothrow: @nogc: +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + public import core.sys.posix.dlfcn; import core.sys.linux.config; // -version (X86) -{ - // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h - // enum RTLD_LAZY = 0x00001; // POSIX - // enum RTLD_NOW = 0x00002; // POSIX - enum RTLD_BINDING_MASK = 0x3; - enum RTLD_NOLOAD = 0x00004; - enum RTLD_DEEPBIND = 0x00008; - - // enum RTLD_GLOBAL = 0x00100; // POSIX - // enum RTLD_LOCAL = 0; // POSIX - enum RTLD_NODELETE = 0x01000; - - static if (__USE_GNU) - { - RT DL_CALL_FCT(RT, Args...)(RT function(Args) fctp, auto ref Args args) - { - _dl_mcount_wrapper_check(cast(void*)fctp); - return fctp(args); - } - - void _dl_mcount_wrapper_check(void* __selfpc); - } -} -else version (X86_64) +version (X86_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h // enum RTLD_LAZY = 0x00001; // POSIX @@ -62,31 +51,7 @@ else version (X86_64) void _dl_mcount_wrapper_check(void* __selfpc); } } -else version (MIPS32) -{ - // http://sourceware.org/git/?p=glibc.git;a=blob;f=ports/sysdeps/mips/bits/dlfcn.h - // enum RTLD_LAZY = 0x0001; // POSIX - // enum RTLD_NOW = 0x0002; // POSIX - enum RTLD_BINDING_MASK = 0x3; - enum RTLD_NOLOAD = 0x00008; - enum RTLD_DEEPBIND = 0x00010; - - // enum RTLD_GLOBAL = 0x0004; // POSIX - // enum RTLD_LOCAL = 0; // POSIX - enum RTLD_NODELETE = 0x01000; - - static if (__USE_GNU) - { - RT DL_CALL_FCT(RT, Args...)(RT function(Args) fctp, auto ref Args args) - { - _dl_mcount_wrapper_check(cast(void*)fctp); - return fctp(args); - } - - void _dl_mcount_wrapper_check(void* __selfpc); - } -} -else version (MIPS64) +else version (MIPS_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=ports/sysdeps/mips/bits/dlfcn.h // enum RTLD_LAZY = 0x0001; // POSIX @@ -110,55 +75,7 @@ else version (MIPS64) void _dl_mcount_wrapper_check(void* __selfpc); } } -else version (PPC) -{ - // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h - // enum RTLD_LAZY = 0x0001; // POSIX - // enum RTLD_NOW = 0x0002; // POSIX - enum RTLD_BINDING_MASK = 0x3; - enum RTLD_NOLOAD = 0x00004; - enum RTLD_DEEPBIND = 0x00008; - - // enum RTLD_GLOBAL = 0x00100; // POSIX - // enum RTLD_LOCAL = 0; // POSIX - enum RTLD_NODELETE = 0x01000; - - static if (__USE_GNU) - { - RT DL_CALL_FCT(RT, Args...)(RT function(Args) fctp, auto ref Args args) - { - _dl_mcount_wrapper_check(cast(void*)fctp); - return fctp(args); - } - - void _dl_mcount_wrapper_check(void* __selfpc); - } -} -else version (PPC64) -{ - // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h - // enum RTLD_LAZY = 0x0001; // POSIX - // enum RTLD_NOW = 0x0002; // POSIX - enum RTLD_BINDING_MASK = 0x3; - enum RTLD_NOLOAD = 0x00004; - enum RTLD_DEEPBIND = 0x00008; - - // enum RTLD_GLOBAL = 0x00100; // POSIX - // enum RTLD_LOCAL = 0; // POSIX - enum RTLD_NODELETE = 0x01000; - - static if (__USE_GNU) - { - RT DL_CALL_FCT(RT, Args...)(RT function(Args) fctp, auto ref Args args) - { - _dl_mcount_wrapper_check(cast(void*)fctp); - return fctp(args); - } - - void _dl_mcount_wrapper_check(void* __selfpc); - } -} -else version (ARM) +else version (PPC_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h // enum RTLD_LAZY = 0x0001; // POSIX @@ -182,7 +99,7 @@ else version (ARM) void _dl_mcount_wrapper_check(void* __selfpc); } } -else version (AArch64) +else version (ARM_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h // enum RTLD_LAZY = 0x0001; // POSIX @@ -206,7 +123,7 @@ else version (AArch64) void _dl_mcount_wrapper_check(void* __selfpc); } } -else version (SPARC64) +else version (SPARC_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h // enum RTLD_LAZY = 0x0001; // POSIX @@ -230,7 +147,7 @@ else version (SPARC64) void _dl_mcount_wrapper_check(void* __selfpc); } } -else version (SystemZ) +else version (IBMZ_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h // enum RTLD_LAZY = 0x0001; // POSIX diff --git a/libphobos/libdruntime/core/sys/linux/epoll.d b/libphobos/libdruntime/core/sys/linux/epoll.d index 3d58c526264..e77cde4fcf7 100644 --- a/libphobos/libdruntime/core/sys/linux/epoll.d +++ b/libphobos/libdruntime/core/sys/linux/epoll.d @@ -15,6 +15,19 @@ extern (C): @nogc: nothrow: +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + enum { EPOLL_CLOEXEC = 0x80000, @@ -46,7 +59,7 @@ enum EPOLL_CTL_MOD = 3, // Change file descriptor epoll_event structure. } -version (X86) +version (X86_Any) { align(1) struct epoll_event { @@ -55,40 +68,7 @@ version (X86) epoll_data_t data; } } -else version (X86_64) -{ - align(1) struct epoll_event - { - align(1): - uint events; - epoll_data_t data; - } -} -else version (ARM) -{ - struct epoll_event - { - uint events; - epoll_data_t data; - } -} -else version (AArch64) -{ - struct epoll_event - { - uint events; - epoll_data_t data; - } -} -else version (PPC) -{ - struct epoll_event - { - uint events; - epoll_data_t data; - } -} -else version (PPC64) +else version (ARM_Any) { struct epoll_event { @@ -96,7 +76,7 @@ else version (PPC64) epoll_data_t data; } } -else version (MIPS32) +else version (PPC_Any) { struct epoll_event { @@ -104,7 +84,7 @@ else version (MIPS32) epoll_data_t data; } } -else version (MIPS64) +else version (MIPS_Any) { struct epoll_event { @@ -112,7 +92,7 @@ else version (MIPS64) epoll_data_t data; } } -else version (SPARC64) +else version (SPARC_Any) { struct epoll_event { @@ -120,7 +100,7 @@ else version (SPARC64) epoll_data_t data; } } -else version (SystemZ) +else version (IBMZ_Any) { struct epoll_event { diff --git a/libphobos/libdruntime/core/sys/linux/link.d b/libphobos/libdruntime/core/sys/linux/link.d index f69f158017e..e22a44590be 100644 --- a/libphobos/libdruntime/core/sys/linux/link.d +++ b/libphobos/libdruntime/core/sys/linux/link.d @@ -9,61 +9,48 @@ version (linux): extern (C): nothrow: +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + import core.stdc.stdint : uintptr_t, uint32_t, uint64_t; import core.sys.linux.config : __WORDSIZE; import core.sys.linux.dlfcn : Lmid_t; import core.sys.linux.elf; // -version (X86) -{ - // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h - alias __WORDSIZE __ELF_NATIVE_CLASS; - alias uint32_t Elf_Symndx; -} -else version (X86_64) -{ - // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h - alias __WORDSIZE __ELF_NATIVE_CLASS; - alias uint32_t Elf_Symndx; -} -else version (MIPS32) -{ - // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h - alias __WORDSIZE __ELF_NATIVE_CLASS; - alias uint32_t Elf_Symndx; -} -else version (MIPS64) -{ - // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h - alias __WORDSIZE __ELF_NATIVE_CLASS; - alias uint32_t Elf_Symndx; -} -else version (PPC) +version (X86_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h alias __WORDSIZE __ELF_NATIVE_CLASS; alias uint32_t Elf_Symndx; } -else version (PPC64) +else version (MIPS_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h alias __WORDSIZE __ELF_NATIVE_CLASS; alias uint32_t Elf_Symndx; } -else version (ARM) +else version (PPC_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h alias __WORDSIZE __ELF_NATIVE_CLASS; alias uint32_t Elf_Symndx; } -else version (AArch64) +else version (ARM_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h alias __WORDSIZE __ELF_NATIVE_CLASS; alias uint32_t Elf_Symndx; } -else version (SPARC64) +else version (SPARC_Any) { // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/elfclass.h alias __WORDSIZE __ELF_NATIVE_CLASS; diff --git a/libphobos/libdruntime/core/sys/linux/sys/auxv.d b/libphobos/libdruntime/core/sys/linux/sys/auxv.d index 1634ccf3c16..5f098e98e02 100644 --- a/libphobos/libdruntime/core/sys/linux/sys/auxv.d +++ b/libphobos/libdruntime/core/sys/linux/sys/auxv.d @@ -11,6 +11,15 @@ import core.stdc.config; version (linux): extern (C): +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; + c_ulong getauxval(c_ulong type) nothrow pure @nogc @system; version (ARM) @@ -56,7 +65,7 @@ else version (AArch64) enum HWCAP_FPHP = 512; enum HWCAP_ASIMDHP = 1024; } -else version (PPC) +else version (PPC_Any) { // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/powerpc/bits/hwcap.h @@ -98,81 +107,7 @@ else version (PPC) enum PPC_FEATURE2_HAS_TAR = 0x04000000; enum PPC_FEATURE2_HAS_VEC_CRYPTO = 0x02000000; } -else version (PPC64) -{ - // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/powerpc/bits/hwcap.h - - enum PPC_FEATURE_32 = 0x80000000; - enum PPC_FEATURE_64 = 0x40000000; - enum PPC_FEATURE_601_INSTR = 0x20000000; - enum PPC_FEATURE_HAS_ALTIVEC = 0x10000000; - enum PPC_FEATURE_HAS_FPU = 0x08000000; - enum PPC_FEATURE_HAS_MMU = 0x04000000; - enum PPC_FEATURE_HAS_4xxMAC = 0x02000000; - enum PPC_FEATURE_UNIFIED_CACHE = 0x01000000; - enum PPC_FEATURE_HAS_SPE = 0x00800000; - enum PPC_FEATURE_HAS_EFP_SINGLE = 0x00400000; - enum PPC_FEATURE_HAS_EFP_DOUBLE = 0x00200000; - enum PPC_FEATURE_NO_TB = 0x00100000; - enum PPC_FEATURE_POWER4 = 0x00080000; - enum PPC_FEATURE_POWER5 = 0x00040000; - enum PPC_FEATURE_POWER5_PLUS = 0x00020000; - enum PPC_FEATURE_CELL_BE = 0x00010000; - enum PPC_FEATURE_BOOKE = 0x00008000; - enum PPC_FEATURE_SMT = 0x00004000; - - enum PPC_FEATURE_ICACHE_SNOOP = 0x00002000; - enum PPC_FEATURE_ARCH_2_05 = 0x00001000; - enum PPC_FEATURE_PA6T = 0x00000800; - enum PPC_FEATURE_HAS_DFP = 0x00000400; - enum PPC_FEATURE_POWER6_EXT = 0x00000200; - enum PPC_FEATURE_ARCH_2_06 = 0x00000100; - enum PPC_FEATURE_HAS_VSX = 0x00000080; - enum PPC_FEATURE_PSERIES_PERFMON_COMPAT = 0x00000040; - enum PPC_FEATURE_TRUE_LE = 0x00000002; - enum PPC_FEATURE_PPC_LE = 0x00000001; - - enum PPC_FEATURE2_ARCH_2_07 = 0x80000000; - enum PPC_FEATURE2_HAS_HTM = 0x40000000; - enum PPC_FEATURE2_HAS_DSCR = 0x20000000; - enum PPC_FEATURE2_HAS_EBB = 0x10000000; - enum PPC_FEATURE2_HAS_ISEL = 0x08000000; - enum PPC_FEATURE2_HAS_TAR = 0x04000000; - enum PPC_FEATURE2_HAS_VEC_CRYPTO = 0x02000000; -} -else version (SPARC) -{ - // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/sparc/bits/hwcap.h - - enum HWCAP_SPARC_FLUSH = 0x00000001; - enum HWCAP_SPARC_STBAR = 0x00000002; - enum HWCAP_SPARC_SWAP = 0x00000004; - enum HWCAP_SPARC_MULDIV = 0x00000008; - enum HWCAP_SPARC_V9 = 0x00000010; - enum HWCAP_SPARC_ULTRA3 = 0x00000020; - enum HWCAP_SPARC_BLKINIT = 0x00000040; - enum HWCAP_SPARC_N2 = 0x00000080; - enum HWCAP_SPARC_MUL32 = 0x00000100; - enum HWCAP_SPARC_DIV32 = 0x00000200; - enum HWCAP_SPARC_FSMULD = 0x00000400; - enum HWCAP_SPARC_V8PLUS = 0x00000800; - enum HWCAP_SPARC_POPC = 0x00001000; - enum HWCAP_SPARC_VIS = 0x00002000; - enum HWCAP_SPARC_VIS2 = 0x00004000; - enum HWCAP_SPARC_ASI_BLK_INIT = 0x00008000; - enum HWCAP_SPARC_FMAF = 0x00010000; - enum HWCAP_SPARC_VIS3 = 0x00020000; - enum HWCAP_SPARC_HPC = 0x00040000; - enum HWCAP_SPARC_RANDOM = 0x00080000; - enum HWCAP_SPARC_TRANS = 0x00100000; - enum HWCAP_SPARC_FJFMAU = 0x00200000; - enum HWCAP_SPARC_IMA = 0x00400000; - enum HWCAP_SPARC_ASI_CACHE_SPARING = 0x00800000; - enum HWCAP_SPARC_PAUSE = 0x01000000; - enum HWCAP_SPARC_CBCOND = 0x02000000; - enum HWCAP_SPARC_CRYPTO = 0x04000000; -} -else version (SPARC64) +else version (SPARC_Any) { // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/sparc/bits/hwcap.h @@ -204,7 +139,7 @@ else version (SPARC64) enum HWCAP_SPARC_CBCOND = 0x02000000; enum HWCAP_SPARC_CRYPTO = 0x04000000; } -else version (SystemZ) +else version (IBMZ_Any) { // See https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/s390/bits/hwcap.h diff --git a/libphobos/libdruntime/core/sys/linux/sys/eventfd.d b/libphobos/libdruntime/core/sys/linux/sys/eventfd.d index 3cd39556b0d..8e8f03a01c6 100644 --- a/libphobos/libdruntime/core/sys/linux/sys/eventfd.d +++ b/libphobos/libdruntime/core/sys/linux/sys/eventfd.d @@ -12,6 +12,19 @@ extern (C): @system: nothrow: +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + import core.stdc.stdint: uint64_t; /// Type for the event counter @@ -27,61 +40,37 @@ int eventfd_read (int fd, eventfd_t* value); /* Increment event counter. */ int eventfd_write (int fd, eventfd_t value); -version (X86) -{ - enum EFD_SEMAPHORE = 1; - enum EFD_CLOEXEC = 0x80000; // octal!2000000 - enum EFD_NONBLOCK = 0x800; // octal!4000 -} -else version (X86_64) +version (X86_Any) { enum EFD_SEMAPHORE = 1; enum EFD_CLOEXEC = 0x80000; // octal!2000000 enum EFD_NONBLOCK = 0x800; // octal!4000 } -else version (MIPS32) -{ - enum EFD_SEMAPHORE = 1; - enum EFD_CLOEXEC = 0x80000; // octal!2000000 - enum EFD_NONBLOCK = 0x80; // octal!200 -} -else version (MIPS64) +else version (MIPS_Any) { enum EFD_SEMAPHORE = 1; enum EFD_CLOEXEC = 0x80000; // octal!2000000 enum EFD_NONBLOCK = 0x80; // octal!200 } -else version (PPC) -{ - enum EFD_SEMAPHORE = 1; - enum EFD_CLOEXEC = 0x80000; // octal!2000000 - enum EFD_NONBLOCK = 0x800; // octal!4000 -} -else version (PPC64) -{ - enum EFD_SEMAPHORE = 1; - enum EFD_CLOEXEC = 0x80000; // octal!2000000 - enum EFD_NONBLOCK = 0x800; // octal!4000 -} -else version (ARM) +else version (PPC_Any) { enum EFD_SEMAPHORE = 1; enum EFD_CLOEXEC = 0x80000; // octal!2000000 enum EFD_NONBLOCK = 0x800; // octal!4000 } -else version (AArch64) +else version (ARM_Any) { enum EFD_SEMAPHORE = 1; enum EFD_CLOEXEC = 0x80000; // octal!2000000 enum EFD_NONBLOCK = 0x800; // octal!4000 } -else version (SPARC64) +else version (SPARC_Any) { enum EFD_SEMAPHORE = 1; enum EFD_CLOEXEC = 0x80000; // octal!2000000 enum EFD_NONBLOCK = 0x800; // octal!4000 } -else version (SystemZ) +else version (IBMZ_Any) { enum EFD_SEMAPHORE = 1; enum EFD_CLOEXEC = 0x80000; // octal!2000000 diff --git a/libphobos/libdruntime/core/sys/linux/sys/inotify.d b/libphobos/libdruntime/core/sys/linux/sys/inotify.d index 793c617795a..301376afa87 100644 --- a/libphobos/libdruntime/core/sys/linux/sys/inotify.d +++ b/libphobos/libdruntime/core/sys/linux/sys/inotify.d @@ -11,6 +11,19 @@ extern (C): @system: nothrow: +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + struct inotify_event { int wd; @@ -53,52 +66,32 @@ enum: uint // Old typo, preserved for compatibility enum IN_UMOUNT = IN_UNMOUNT; -version (X86) -{ - enum IN_CLOEXEC = 0x80000; // octal!2000000 - enum IN_NONBLOCK = 0x800; // octal!4000 -} -else version (X86_64) +version (X86_Any) { enum IN_CLOEXEC = 0x80000; // octal!2000000 enum IN_NONBLOCK = 0x800; // octal!4000 } -else version (MIPS32) -{ - enum IN_CLOEXEC = 0x80000; // octal!2000000 - enum IN_NONBLOCK = 0x80; // octal!200 -} -else version (MIPS64) +else version (MIPS_Any) { enum IN_CLOEXEC = 0x80000; // octal!2000000 enum IN_NONBLOCK = 0x80; // octal!200 } -else version (PPC) -{ - enum IN_CLOEXEC = 0x80000; // octal!2000000 - enum IN_NONBLOCK = 0x800; // octal!4000 -} -else version (PPC64) -{ - enum IN_CLOEXEC = 0x80000; // octal!2000000 - enum IN_NONBLOCK = 0x800; // octal!4000 -} -else version (ARM) +else version (PPC_Any) { enum IN_CLOEXEC = 0x80000; // octal!2000000 enum IN_NONBLOCK = 0x800; // octal!4000 } -else version (AArch64) +else version (ARM_Any) { enum IN_CLOEXEC = 0x80000; // octal!2000000 enum IN_NONBLOCK = 0x800; // octal!4000 } -else version (SPARC64) +else version (SPARC_Any) { enum IN_CLOEXEC = 0x80000; // octal!2000000 enum IN_NONBLOCK = 0x800; // octal!4000 } -else version (SystemZ) +else version (IBMZ_Any) { enum IN_CLOEXEC = 0x80000; // octal!2000000 enum IN_NONBLOCK = 0x800; // octal!4000 diff --git a/libphobos/libdruntime/core/sys/linux/sys/mman.d b/libphobos/libdruntime/core/sys/linux/sys/mman.d index 26b0d2fcd76..5e304112841 100644 --- a/libphobos/libdruntime/core/sys/linux/sys/mman.d +++ b/libphobos/libdruntime/core/sys/linux/sys/mman.d @@ -9,37 +9,27 @@ version (linux): extern (C): nothrow: +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (HPPA) version = HPPA_Any; +version (HPPA64) version = HPPA_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + public import core.sys.posix.sys.mman; import core.sys.linux.config; // // http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/powerpc/bits/mman.h -version (PPC) -{ - enum PROT_SAO = 0x10; - - static if (__USE_MISC) enum - { - MAP_GROWSDOWN = 0x00100, - MAP_DENYWRITE = 0x00800, - MAP_EXECUTABLE = 0x01000, - MAP_LOCKED = 0x00080, - MAP_NORESERVE = 0x00040, - MAP_POPULATE = 0x08000, - MAP_NONBLOCK = 0x10000, - MAP_STACK = 0x20000, - MAP_HUGETLB = 0x40000, - } - - // in core.sys.posix.sys.mman - // enum - // { - // MCL_CURRENT = 0x2000, - // MCL_FUTURE = 0x4000, - // } -} -// http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/powerpc/bits/mman.h -else version (PPC64) +version (PPC_Any) { enum PROT_SAO = 0x10; @@ -64,23 +54,7 @@ else version (PPC64) // } } // http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/s390/bits/mman.h -else version (S390) -{ - static if (__USE_MISC) enum - { - MAP_GROWSDOWN = 0x00100, - MAP_DENYWRITE = 0x00800, - MAP_EXECUTABLE = 0x01000, - MAP_LOCKED = 0x02000, - MAP_NORESERVE = 0x04000, - MAP_POPULATE = 0x08000, - MAP_NONBLOCK = 0x10000, - MAP_STACK = 0x20000, - MAP_HUGETLB = 0x40000, - } -} -// http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/s390/bits/mman.h -else version (SystemZ) +else version (IBMZ_Any) { static if (__USE_MISC) enum { @@ -112,31 +86,7 @@ else version (SH) } } // http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/sparc/bits/mman.h -else version (SPARC) -{ - static if (__USE_MISC) enum - { - MAP_GROWSDOWN = 0x0200, - MAP_DENYWRITE = 0x0800, - MAP_EXECUTABLE = 0x1000, - MAP_LOCKED = 0x0100, - MAP_NORESERVE = 0x0040, - _MAP_NEW = 0x80000000, - MAP_POPULATE = 0x8000, - MAP_NONBLOCK = 0x10000, - MAP_STACK = 0x20000, - MAP_HUGETLB = 0x40000, - } - - // in core.sys.posix.sys.mman - // enum - // { - // MCL_CURRENT = 0x2000, - // MCL_FUTURE = 0x4000, - // } -} -// http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/sparc/bits/mman.h -else version (SPARC64) +else version (SPARC_Any) { static if (__USE_MISC) enum { @@ -160,25 +110,7 @@ else version (SPARC64) // } } // http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/x86/bits/mman.h -else version (X86) -{ - static if (__USE_MISC) enum MAP_32BIT = 0x40; - - static if (__USE_MISC) enum - { - MAP_GROWSDOWN = 0x00100, - MAP_DENYWRITE = 0x00800, - MAP_EXECUTABLE = 0x01000, - MAP_LOCKED = 0x02000, - MAP_NORESERVE = 0x04000, - MAP_POPULATE = 0x08000, - MAP_NONBLOCK = 0x10000, - MAP_STACK = 0x20000, - MAP_HUGETLB = 0x40000, - } -} -// http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/x86/bits/mman.h -else version (X86_64) +else version (X86_Any) { static if (__USE_MISC) enum MAP_32BIT = 0x40; @@ -320,111 +252,7 @@ else version (ARM) } } // http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/hppa/bits/mman.h -else version (HPPA) -{ - enum - { - PROT_READ = 0x1, - PROT_WRITE = 0x2, - PROT_EXEC = 0x4, - PROT_NONE = 0x0, - PROT_GROWSDOWN = 0x01000000, - PROT_GROWSUP = 0x02000000, - } - - enum MAP_SHARED = 0x01; - enum MAP_PRIVATE = 0x02; - static if (__USE_MISC) - enum MAP_TYPE = 0x0f; - - enum MAP_FIXED = 0x04; - static if (__USE_MISC) enum - { - MAP_FILE = 0, - MAP_ANONYMOUS = MAP_ANON, - // in core.sys.posix.sys.mman - // MAP_ANON = MAP_ANONYMOUS, - MAP_VARIABLE = 0, - MAP_HUGE_SHIFT = 26, - MAP_HUGE_MASK = 0x3f, - } - - static if (__USE_MISC) enum - { - MAP_DENYWRITE = 0x0800, - MAP_EXECUTABLE = 0x1000, - MAP_LOCKED = 0x2000, - MAP_NORESERVE = 0x4000, - MAP_GROWSDOWN = 0x8000, - MAP_POPULATE = 0x10000, - MAP_NONBLOCK = 0x20000, - } - - // in core.sys.posix.sys.mman - // enum - // { - // MS_ASYNC = 1, - // MS_SYNC = 2, - // MS_INVALIDATE = 4, - // } - - // in core.sys.posix.sys.mman - // enum - // { - // MCL_CURRENT = 1, - // MCL_FUTURE = 2, - // } - - static if (__USE_GNU) enum - { - MREMAP_MAYMOVE = 1, - MREMAP_FIXED = 2, - } - - static if (__USE_MISC) enum - { - MADV_NORMAL = 0, - MADV_RANDOM = 1, - MADV_SEQUENTIAL = 2, - MADV_WILLNEED = 3, - MADV_DONTNEED = 4, - MADV_SPACEAVAIL = 5, - MADV_VPS_PURGE = 6, - MADV_VPS_INHERIT = 7, - MADV_REMOVE = 9, - MADV_DONTFORK = 10, - MADV_DOFORK = 11, - MADV_MERGEABLE = 65, - MADV_UNMERGEABLE = 66, - MADV_HUGEPAGE = 67, - MADV_NOHUGEPAGE = 68, - MADV_DONTDUMP = 69, - } - - deprecated("MADV_*_PAGES are gone and never had any effect") enum - { - MADV_4K_PAGES = 12, - MADV_16K_PAGES = 14, - MADV_64K_PAGES = 16, - MADV_256K_PAGES = 18, - MADV_1M_PAGES = 20, - MADV_4M_PAGES = 22, - MADV_16M_PAGES = 24, - MADV_64M_PAGES = 26, - } - - // in core.sys.posix.sys.mman - // static if (__USE_XOPEN2K) enum - // { - // POSIX_MADV_NORMAL = 0, - // POSIX_MADV_RANDOM = 1, - // POSIX_MADV_SEQUENTIAL = 2, - // POSIX_MADV_WILLNEED = 3, - // POSIX_MADV_DONTNEED = 4, - // } -} -// http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/hppa/bits/mman.h -else version (HPPA64) +else version (HPPA_Any) { enum { @@ -503,7 +331,6 @@ else version (HPPA64) MADV_HUGEPAGE = 67, MADV_NOHUGEPAGE = 68, MADV_DONTDUMP = 69, - MADV_DODUMP = 70, } deprecated("MADV_*_PAGES are gone and never had any effect") enum @@ -562,23 +389,7 @@ else version (M68K) } } // http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/mips/bits/mman.h -else version (MIPS32) -{ - static if (__USE_MISC) enum - { - MAP_NORESERVE = 0x0400, - MAP_GROWSDOWN = 0x1000, - MAP_DENYWRITE = 0x2000, - MAP_EXECUTABLE = 0x4000, - MAP_LOCKED = 0x8000, - MAP_POPULATE = 0x10000, - MAP_NONBLOCK = 0x20000, - MAP_STACK = 0x40000, - MAP_HUGETLB = 0x80000, - } -} -// https://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/mips/bits/mman.h -else version (MIPS64) +else version (MIPS_Any) { static if (__USE_MISC) enum { @@ -604,10 +415,7 @@ else version (Alpha) { } -else version (HPPA) -{ -} -else version (HPPA64) +else version (HPPA_Any) { } else @@ -691,22 +499,12 @@ else // Workaround https://issues.dlang.org/show_bug.cgi?id=17883 // http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/sparc/bits/mman.h -version (SPARC) -{ - static if (__USE_MISC) enum MAP_RENAME = MAP_ANONYMOUS; -} -// http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/sparc/bits/mman.h -else version (SPARC64) +version (SPARC_Any) { static if (__USE_MISC) enum MAP_RENAME = MAP_ANONYMOUS; } // http://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/mips/bits/mman.h -else version (MIPS32) -{ - static if (__USE_MISC) enum MAP_RENAME = MAP_ANONYMOUS; -} -// https://sourceware.org/git/?p=glibc.git;a=blob;hb=51e945a8f950a6695754b11c1e6fba8bb750e100;f=sysdeps/unix/sysv/linux/mips/bits/mman.h -else version (MIPS64) +else version (MIPS_Any) { static if (__USE_MISC) enum MAP_RENAME = MAP_ANONYMOUS; } diff --git a/libphobos/libdruntime/core/sys/posix/dlfcn.d b/libphobos/libdruntime/core/sys/posix/dlfcn.d index 1a9f0521ca4..e1c3ba08245 100644 --- a/libphobos/libdruntime/core/sys/posix/dlfcn.d +++ b/libphobos/libdruntime/core/sys/posix/dlfcn.d @@ -25,6 +25,19 @@ else version (TVOS) else version (WatchOS) version = Darwin; +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + version (Posix): extern (C): nothrow: @@ -47,70 +60,42 @@ void* dlsym(void*, in char*); version (CRuntime_Glibc) { - version (X86) - { - enum RTLD_LAZY = 0x00001; - enum RTLD_NOW = 0x00002; - enum RTLD_GLOBAL = 0x00100; - enum RTLD_LOCAL = 0x00000; - } - else version (X86_64) + version (X86_Any) { enum RTLD_LAZY = 0x00001; enum RTLD_NOW = 0x00002; enum RTLD_GLOBAL = 0x00100; enum RTLD_LOCAL = 0x00000; } - else version (MIPS32) - { - enum RTLD_LAZY = 0x0001; - enum RTLD_NOW = 0x0002; - enum RTLD_GLOBAL = 0x0004; - enum RTLD_LOCAL = 0; - } - else version (MIPS64) + else version (MIPS_Any) { enum RTLD_LAZY = 0x0001; enum RTLD_NOW = 0x0002; enum RTLD_GLOBAL = 0x0004; enum RTLD_LOCAL = 0; } - else version (PPC) - { - enum RTLD_LAZY = 0x00001; - enum RTLD_NOW = 0x00002; - enum RTLD_GLOBAL = 0x00100; - enum RTLD_LOCAL = 0; - } - else version (PPC64) - { - enum RTLD_LAZY = 0x00001; - enum RTLD_NOW = 0x00002; - enum RTLD_GLOBAL = 0x00100; - enum RTLD_LOCAL = 0; - } - else version (ARM) + else version (PPC_Any) { enum RTLD_LAZY = 0x00001; enum RTLD_NOW = 0x00002; enum RTLD_GLOBAL = 0x00100; enum RTLD_LOCAL = 0; } - else version (AArch64) + else version (ARM_Any) { enum RTLD_LAZY = 0x00001; enum RTLD_NOW = 0x00002; enum RTLD_GLOBAL = 0x00100; enum RTLD_LOCAL = 0; } - else version (SPARC64) + else version (SPARC_Any) { enum RTLD_LAZY = 0x00001; enum RTLD_NOW = 0x00002; enum RTLD_GLOBAL = 0x00100; enum RTLD_LOCAL = 0; } - else version (SystemZ) + else version (IBMZ_Any) { enum RTLD_LAZY = 0x00001; enum RTLD_NOW = 0x00002; diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d index 339dcd49106..1bdc6eca0f2 100644 --- a/libphobos/libdruntime/core/sys/posix/fcntl.d +++ b/libphobos/libdruntime/core/sys/posix/fcntl.d @@ -28,6 +28,19 @@ else version (TVOS) else version (WatchOS) version = Darwin; +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + version (Posix): extern (C): @@ -126,20 +139,7 @@ version (CRuntime_Glibc) enum F_UNLCK = 2; enum F_WRLCK = 1; - version (X86) - { - enum O_CREAT = 0x40; // octal 0100 - enum O_EXCL = 0x80; // octal 0200 - enum O_NOCTTY = 0x100; // octal 0400 - enum O_TRUNC = 0x200; // octal 01000 - - enum O_APPEND = 0x400; // octal 02000 - enum O_NONBLOCK = 0x800; // octal 04000 - enum O_SYNC = 0x101000; // octal 04010000 - enum O_DSYNC = 0x1000; // octal 010000 - enum O_RSYNC = O_SYNC; - } - else version (X86_64) + version (X86_Any) { enum O_CREAT = 0x40; // octal 0100 enum O_EXCL = 0x80; // octal 0200 @@ -152,20 +152,7 @@ version (CRuntime_Glibc) enum O_DSYNC = 0x1000; // octal 010000 enum O_RSYNC = O_SYNC; } - else version (MIPS32) - { - enum O_CREAT = 0x0100; - enum O_EXCL = 0x0400; - enum O_NOCTTY = 0x0800; - enum O_TRUNC = 0x0200; - - enum O_APPEND = 0x0008; - enum O_DSYNC = O_SYNC; - enum O_NONBLOCK = 0x0080; - enum O_RSYNC = O_SYNC; - enum O_SYNC = 0x0010; - } - else version (MIPS64) + else version (MIPS_Any) { enum O_CREAT = 0x0100; enum O_EXCL = 0x0400; @@ -178,7 +165,7 @@ version (CRuntime_Glibc) enum O_RSYNC = O_SYNC; enum O_SYNC = 0x4010; } - else version (PPC) + else version (PPC_Any) { enum O_CREAT = 0x40; // octal 0100 enum O_EXCL = 0x80; // octal 0200 @@ -191,33 +178,7 @@ version (CRuntime_Glibc) enum O_DSYNC = 0x1000; // octal 010000 enum O_RSYNC = O_SYNC; } - else version (PPC64) - { - enum O_CREAT = 0x40; // octal 0100 - enum O_EXCL = 0x80; // octal 0200 - enum O_NOCTTY = 0x100; // octal 0400 - enum O_TRUNC = 0x200; // octal 01000 - - enum O_APPEND = 0x400; // octal 02000 - enum O_NONBLOCK = 0x800; // octal 04000 - enum O_SYNC = 0x101000; // octal 04010000 - enum O_DSYNC = 0x1000; // octal 010000 - enum O_RSYNC = O_SYNC; - } - else version (ARM) - { - enum O_CREAT = 0x40; // octal 0100 - enum O_EXCL = 0x80; // octal 0200 - enum O_NOCTTY = 0x100; // octal 0400 - enum O_TRUNC = 0x200; // octal 01000 - - enum O_APPEND = 0x400; // octal 02000 - enum O_NONBLOCK = 0x800; // octal 04000 - enum O_SYNC = 0x101000; // octal 04010000 - enum O_DSYNC = 0x1000; // octal 010000 - enum O_RSYNC = O_SYNC; - } - else version (AArch64) + else version (ARM_Any) { enum O_CREAT = 0x40; // octal 0100 enum O_EXCL = 0x80; // octal 0200 @@ -230,7 +191,7 @@ version (CRuntime_Glibc) enum O_DSYNC = 0x1000; // octal 010000 enum O_RSYNC = O_SYNC; } - else version (SPARC64) + else version (SPARC_Any) { enum O_CREAT = 0x200; enum O_EXCL = 0x800; @@ -243,7 +204,7 @@ version (CRuntime_Glibc) enum O_DSYNC = 0x2000; enum O_RSYNC = O_SYNC; } - else version (SystemZ) + else version (IBMZ_Any) { enum O_CREAT = 0x40; // octal 0100 enum O_EXCL = 0x80; // octal 0200 diff --git a/libphobos/libdruntime/core/sys/posix/signal.d b/libphobos/libdruntime/core/sys/posix/signal.d index b70ac6b4ab8..2cd81c87f06 100644 --- a/libphobos/libdruntime/core/sys/posix/signal.d +++ b/libphobos/libdruntime/core/sys/posix/signal.d @@ -25,6 +25,19 @@ else version (TVOS) else version (WatchOS) version = Darwin; +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + version (Posix): extern (C): //nothrow: // this causes Issue 12738 @@ -219,7 +232,7 @@ else version (CRuntime_UClibc) version (linux) { - version (X86) + version (X86_Any) { //SIGABRT (defined in core.stdc.signal) enum SIGALRM = 14; @@ -243,31 +256,7 @@ version (linux) enum SIGUSR2 = 12; enum SIGURG = 23; } - else version (X86_64) - { - //SIGABRT (defined in core.stdc.signal) - enum SIGALRM = 14; - enum SIGBUS = 7; - enum SIGCHLD = 17; - enum SIGCONT = 18; - //SIGFPE (defined in core.stdc.signal) - enum SIGHUP = 1; - //SIGILL (defined in core.stdc.signal) - //SIGINT (defined in core.stdc.signal) - enum SIGKILL = 9; - enum SIGPIPE = 13; - enum SIGQUIT = 3; - //SIGSEGV (defined in core.stdc.signal) - enum SIGSTOP = 19; - //SIGTERM (defined in core.stdc.signal) - enum SIGTSTP = 20; - enum SIGTTIN = 21; - enum SIGTTOU = 22; - enum SIGUSR1 = 10; - enum SIGUSR2 = 12; - enum SIGURG = 23; - } - else version (MIPS32) + else version (MIPS_Any) { //SIGABRT (defined in core.stdc.signal) enum SIGALRM = 14; @@ -291,31 +280,7 @@ version (linux) enum SIGUSR2 = 17; enum SIGURG = 21; } - else version (MIPS64) - { - //SIGABRT (defined in core.stdc.signal) - enum SIGALRM = 14; - enum SIGBUS = 10; - enum SIGCHLD = 18; - enum SIGCONT = 25; - //SIGFPE (defined in core.stdc.signal) - enum SIGHUP = 1; - //SIGILL (defined in core.stdc.signal) - //SIGINT (defined in core.stdc.signal) - enum SIGKILL = 9; - enum SIGPIPE = 13; - enum SIGQUIT = 3; - //SIGSEGV (defined in core.stdc.signal) - enum SIGSTOP = 23; - //SIGTERM (defined in core.stdc.signal) - enum SIGTSTP = 24; - enum SIGTTIN = 26; - enum SIGTTOU = 27; - enum SIGUSR1 = 16; - enum SIGUSR2 = 17; - enum SIGURG = 21; - } - else version (PPC) + else version (PPC_Any) { //SIGABRT (defined in core.stdc.signal) enum SIGALRM = 14; @@ -339,7 +304,7 @@ version (linux) enum SIGUSR2 = 12; enum SIGURG = 23; } - else version (PPC64) + else version (ARM_Any) { //SIGABRT (defined in core.stdc.signal) enum SIGALRM = 14; @@ -363,55 +328,7 @@ version (linux) enum SIGUSR2 = 12; enum SIGURG = 23; } - else version (ARM) - { - //SIGABRT (defined in core.stdc.signal) - enum SIGALRM = 14; - enum SIGBUS = 7; - enum SIGCHLD = 17; - enum SIGCONT = 18; - //SIGFPE (defined in core.stdc.signal) - enum SIGHUP = 1; - //SIGILL (defined in core.stdc.signal) - //SIGINT (defined in core.stdc.signal) - enum SIGKILL = 9; - enum SIGPIPE = 13; - enum SIGQUIT = 3; - //SIGSEGV (defined in core.stdc.signal) - enum SIGSTOP = 19; - //SIGTERM (defined in core.stdc.signal) - enum SIGTSTP = 20; - enum SIGTTIN = 21; - enum SIGTTOU = 22; - enum SIGUSR1 = 10; - enum SIGUSR2 = 12; - enum SIGURG = 23; - } - else version (AArch64) - { - //SIGABRT (defined in core.stdc.signal) - enum SIGALRM = 14; - enum SIGBUS = 7; - enum SIGCHLD = 17; - enum SIGCONT = 18; - //SIGFPE (defined in core.stdc.signal) - enum SIGHUP = 1; - //SIGILL (defined in core.stdc.signal) - //SIGINT (defined in core.stdc.signal) - enum SIGKILL = 9; - enum SIGPIPE = 13; - enum SIGQUIT = 3; - //SIGSEGV (defined in core.stdc.signal) - enum SIGSTOP = 19; - //SIGTERM (defined in core.stdc.signal) - enum SIGTSTP = 20; - enum SIGTTIN = 21; - enum SIGTTOU = 22; - enum SIGUSR1 = 10; - enum SIGUSR2 = 12; - enum SIGURG = 23; - } - else version (SPARC64) + else version (SPARC_Any) { //SIGABRT (defined in core.stdc.signal) enum SIGALRM = 14; @@ -435,7 +352,7 @@ version (linux) enum SIGUSR2 = 31; enum SIGURG = 16; } - else version (SystemZ) + else version (IBMZ_Any) { //SIGABRT (defined in core.stdc.signal) enum SIGALRM = 14; @@ -2062,17 +1979,7 @@ int sigrelse(int); version (CRuntime_Glibc) { - version (X86) - { - enum SIGPOLL = 29; - enum SIGPROF = 27; - enum SIGSYS = 31; - enum SIGTRAP = 5; - enum SIGVTALRM = 26; - enum SIGXCPU = 24; - enum SIGXFSZ = 25; - } - else version (X86_64) + version (X86_Any) { enum SIGPOLL = 29; enum SIGPROF = 27; @@ -2082,7 +1989,7 @@ version (CRuntime_Glibc) enum SIGXCPU = 24; enum SIGXFSZ = 25; } - else version (MIPS32) + else version (MIPS_Any) { enum SIGPOLL = 22; enum SIGPROF = 29; @@ -2092,27 +1999,7 @@ version (CRuntime_Glibc) enum SIGXCPU = 30; enum SIGXFSZ = 31; } - else version (MIPS64) - { - enum SIGPOLL = 22; - enum SIGPROF = 29; - enum SIGSYS = 12; - enum SIGTRAP = 5; - enum SIGVTALRM = 28; - enum SIGXCPU = 30; - enum SIGXFSZ = 31; - } - else version (PPC) - { - enum SIGPOLL = 29; - enum SIGPROF = 27; - enum SIGSYS = 31; - enum SIGTRAP = 5; - enum SIGVTALRM = 26; - enum SIGXCPU = 24; - enum SIGXFSZ = 25; - } - else version (PPC64) + else version (PPC_Any) { enum SIGPOLL = 29; enum SIGPROF = 27; @@ -2122,17 +2009,7 @@ version (CRuntime_Glibc) enum SIGXCPU = 24; enum SIGXFSZ = 25; } - else version (ARM) - { - enum SIGPOLL = 29; - enum SIGPROF = 27; - enum SIGSYS = 31; - enum SIGTRAP = 5; - enum SIGVTALRM = 26; - enum SIGXCPU = 24; - enum SIGXFSZ = 25; - } - else version (AArch64) + else version (ARM_Any) { enum SIGPOLL = 29; enum SIGPROF = 27; @@ -2142,7 +2019,7 @@ version (CRuntime_Glibc) enum SIGXCPU = 24; enum SIGXFSZ = 25; } - else version (SPARC64) + else version (SPARC_Any) { enum SIGPOLL = 23; enum SIGPROF = 27; @@ -2152,7 +2029,7 @@ version (CRuntime_Glibc) enum SIGXCPU = 24; enum SIGXFSZ = 25; } - else version (SystemZ) + else version (IBMZ_Any) { enum SIGPOLL = 29; enum SIGPROF = 27; diff --git a/libphobos/libdruntime/core/sys/posix/sys/mman.d b/libphobos/libdruntime/core/sys/posix/sys/mman.d index b9da7348ff3..0f534c53b29 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/mman.d +++ b/libphobos/libdruntime/core/sys/posix/sys/mman.d @@ -26,6 +26,21 @@ else version (TVOS) else version (WatchOS) version = Darwin; +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (HPPA) version = HPPA_Any; +version (HPPA64) version = HPPA_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + version (Posix): extern (C) nothrow @nogc: @@ -313,25 +328,13 @@ version (CRuntime_Glibc) } else version (SH) private enum DEFAULTS = true; - else version (AArch64) - private enum DEFAULTS = true; - else version (ARM) - private enum DEFAULTS = true; - else version (S390) + else version (ARM_Any) private enum DEFAULTS = true; - else version (SystemZ) + else version (IBMZ_Any) private enum DEFAULTS = true; else version (IA64) private enum DEFAULTS = true; - else version (HPPA) - { - private enum DEFAULTS = false; - enum MAP_ANON = 0x10; - enum MS_SYNC = 1; - enum MS_ASYNC = 2; - enum MS_INVALIDATE = 4; - } - else version (HPPA64) + else version (HPPA_Any) { private enum DEFAULTS = false; enum MAP_ANON = 0x10; @@ -343,11 +346,9 @@ version (CRuntime_Glibc) private enum DEFAULTS = true; else version (TILE) private enum DEFAULTS = true; - else version (X86) + else version (X86_Any) private enum DEFAULTS = true; - else version (X86_64) - private enum DEFAULTS = true; - else version (MIPS32) + else version (MIPS_Any) { private enum DEFAULTS = false; enum MAP_ANON = 0x0800; @@ -355,21 +356,9 @@ version (CRuntime_Glibc) enum MS_INVALIDATE = 2; enum MS_SYNC = 4; } - else version (MIPS64) - { - private enum DEFAULTS = false; - enum MAP_ANON = 0x0800; - enum MS_ASYNC = 1; - enum MS_INVALIDATE = 2; - enum MS_SYNC = 4; - } - else version (SPARC) - private enum DEFAULTS = true; - else version (SPARC64) + else version (SPARC_Any) private enum DEFAULTS = true; - else version (PPC) - private enum DEFAULTS = true; - else version (PPC64) + else version (PPC_Any) private enum DEFAULTS = true; else static assert(0, "unimplemented"); @@ -559,22 +548,12 @@ int munlockall(); version (CRuntime_Glibc) { - version (SPARC) enum - { - MCL_CURRENT = 0x2000, - MCL_FUTURE = 0x4000, - } - else version (SPARC64) enum - { - MCL_CURRENT = 0x2000, - MCL_FUTURE = 0x4000, - } - else version (PPC) enum + version (SPARC_Any) enum { MCL_CURRENT = 0x2000, MCL_FUTURE = 0x4000, } - else version (PPC64) enum + else version (PPC_Any) enum { MCL_CURRENT = 0x2000, MCL_FUTURE = 0x4000, diff --git a/libphobos/libdruntime/core/sys/posix/sys/socket.d b/libphobos/libdruntime/core/sys/posix/sys/socket.d index 6a82918aaba..db13bdf2301 100644 --- a/libphobos/libdruntime/core/sys/posix/sys/socket.d +++ b/libphobos/libdruntime/core/sys/posix/sys/socket.d @@ -27,6 +27,19 @@ else version (TVOS) else version (WatchOS) version = Darwin; +version (ARM) version = ARM_Any; +version (AArch64) version = ARM_Any; +version (MIPS32) version = MIPS_Any; +version (MIPS64) version = MIPS_Any; +version (PPC) version = PPC_Any; +version (PPC64) version = PPC_Any; +version (S390) version = IBMZ_Any; +version (SPARC) version = SPARC_Any; +version (SPARC64) version = SPARC_Any; +version (SystemZ) version = IBMZ_Any; +version (X86) version = X86_Any; +version (X86_64) version = X86_Any; + version (Posix): extern (C) nothrow @nogc: @@ -240,42 +253,7 @@ version (CRuntime_Glibc) int l_linger; } - version (X86) - { - enum - { - SOCK_DGRAM = 2, - SOCK_SEQPACKET = 5, - SOCK_STREAM = 1 - } - - enum - { - SOL_SOCKET = 1 - } - - enum - { - SO_ACCEPTCONN = 30, - SO_BROADCAST = 6, - SO_DEBUG = 1, - SO_DONTROUTE = 5, - SO_ERROR = 4, - SO_KEEPALIVE = 9, - SO_LINGER = 13, - SO_OOBINLINE = 10, - SO_RCVBUF = 8, - SO_RCVLOWAT = 18, - SO_RCVTIMEO = 20, - SO_REUSEADDR = 2, - SO_REUSEPORT = 15, - SO_SNDBUF = 7, - SO_SNDLOWAT = 19, - SO_SNDTIMEO = 21, - SO_TYPE = 3 - } - } - else version (X86_64) + version (X86_Any) { enum { @@ -310,41 +288,7 @@ version (CRuntime_Glibc) SO_TYPE = 3 } } - else version (MIPS32) - { - enum - { - SOCK_DGRAM = 1, - SOCK_SEQPACKET = 5, - SOCK_STREAM = 2, - } - - enum - { - SOL_SOCKET = 0xffff - } - - enum - { - SO_ACCEPTCONN = 0x1009, - SO_BROADCAST = 0x0020, - SO_DEBUG = 0x0001, - SO_DONTROUTE = 0x0010, - SO_ERROR = 0x1007, - SO_KEEPALIVE = 0x0008, - SO_LINGER = 0x0080, - SO_OOBINLINE = 0x0100, - SO_RCVBUF = 0x1002, - SO_RCVLOWAT = 0x1004, - SO_RCVTIMEO = 0x1006, - SO_REUSEADDR = 0x0004, - SO_SNDBUF = 0x1001, - SO_SNDLOWAT = 0x1003, - SO_SNDTIMEO = 0x1005, - SO_TYPE = 0x1008, - } - } - else version (MIPS64) + else version (MIPS_Any) { enum { @@ -378,7 +322,7 @@ version (CRuntime_Glibc) SO_TYPE = 0x1008, } } - else version (PPC) + else version (PPC_Any) { enum { @@ -412,76 +356,7 @@ version (CRuntime_Glibc) SO_TYPE = 3 } } - else version (PPC64) - { - enum - { - SOCK_DGRAM = 2, - SOCK_SEQPACKET = 5, - SOCK_STREAM = 1 - } - - enum - { - SOL_SOCKET = 1 - } - - enum - { - SO_ACCEPTCONN = 30, - SO_BROADCAST = 6, - SO_DEBUG = 1, - SO_DONTROUTE = 5, - SO_ERROR = 4, - SO_KEEPALIVE = 9, - SO_LINGER = 13, - SO_OOBINLINE = 10, - SO_RCVBUF = 8, - SO_RCVLOWAT = 16, - SO_RCVTIMEO = 18, - SO_REUSEADDR = 2, - SO_SNDBUF = 7, - SO_SNDLOWAT = 17, - SO_SNDTIMEO = 19, - SO_TYPE = 3 - } - } - else version (AArch64) - { - enum - { - SOCK_DGRAM = 2, - SOCK_SEQPACKET = 5, - SOCK_STREAM = 1 - } - - enum - { - SOL_SOCKET = 1 - } - - enum - { - SO_ACCEPTCONN = 30, - SO_BROADCAST = 6, - SO_DEBUG = 1, - SO_DONTROUTE = 5, - SO_ERROR = 4, - SO_KEEPALIVE = 9, - SO_LINGER = 13, - SO_OOBINLINE = 10, - SO_RCVBUF = 8, - SO_RCVLOWAT = 18, - SO_RCVTIMEO = 20, - SO_REUSEADDR = 2, - SO_REUSEPORT = 15, - SO_SNDBUF = 7, - SO_SNDLOWAT = 19, - SO_SNDTIMEO = 21, - SO_TYPE = 3 - } - } - else version (ARM) + else version (ARM_Any) { enum { @@ -516,7 +391,7 @@ version (CRuntime_Glibc) SO_TYPE = 3 } } - else version (SPARC64) + else version (SPARC_Any) { enum { @@ -550,7 +425,7 @@ version (CRuntime_Glibc) SO_TYPE = 3 } } - else version (SystemZ) + else version (IBMZ_Any) { enum { -- 2.30.2