From 1fc925b692ce11612c9c0d24d42e349b2229906a Mon Sep 17 00:00:00 2001 From: sean Date: Sat, 4 Oct 2008 00:38:57 +0000 Subject: [PATCH] Applied freebsd stdc changes from Tango. git-svn-id: http://svn.dsource.org/projects/druntime/trunk@13 4a9d5153-6564-4b3f-b5e1-7e8e9dac548f --- import/stdc/fenv.d | 25 +- import/stdc/math.d | 629 ++++++++++++++++++--------- import/stdc/posix/pthread.d | 46 ++ import/stdc/posix/semaphore.d | 19 +- import/stdc/posix/signal.d | 31 +- import/stdc/posix/stdlib.d | 7 + import/stdc/posix/sys/mman.d | 2 +- import/stdc/posix/sys/stat.d | 44 +- import/stdc/posix/sys/types.d | 67 +-- import/stdc/posix/termios.d | 114 ++++- import/stdc/posix/time.d | 2 + import/stdc/posix/unistd.d | 5 + import/stdc/tgmath.d | 795 ++++++++++++++++++++++++---------- import/stdc/time.d | 6 +- 14 files changed, 1257 insertions(+), 535 deletions(-) diff --git a/import/stdc/fenv.d b/import/stdc/fenv.d index 8b2dd8c..cdeb2da 100644 --- a/import/stdc/fenv.d +++ b/import/stdc/fenv.d @@ -64,17 +64,17 @@ else version ( darwin ) } else version ( freebsd ) { - struct fenv_t - { - ushort __control; - ushort __mxcsr_hi; - ushort __status; - ushort __mxcsr_lo; - uint __tag; - byte[16] __other; - } + struct fenv_t + { + ushort __control; + ushort __mxcsr_hi; + ushort __status; + ushort __mxcsr_lo; + uint __tag; + byte[16] __other; + } - alias ushort fexcept_t; + alias ushort fexcept_t; } else { @@ -110,6 +110,11 @@ else version( darwin ) private extern fenv_t _FE_DFL_ENV; fenv_t* FE_DFL_ENV = &_FE_DFL_ENV; } +else version( freebsd ) +{ + private extern fenv_t __fe_dfl_env; + fenv_t* FE_DFL_ENV = &__fe_dfl_env; +} else { static assert( false ); diff --git a/import/stdc/math.d b/import/stdc/math.d index 3baa33a..3c1881a 100644 --- a/import/stdc/math.d +++ b/import/stdc/math.d @@ -365,11 +365,11 @@ else version( freebsd ) { enum { - FP_INFINITE = 0x01, - FP_NAN = 0x02, - FP_NORMAL = 0x04, - FP_SUBNORMAL = 0x08, - FP_ZERO = 0x10 + FP_INFINITE = 0x01, + FP_NAN = 0x02, + FP_NORMAL = 0x04, + FP_SUBNORMAL = 0x08, + FP_ZERO = 0x10 } enum @@ -379,43 +379,43 @@ else version( freebsd ) FP_FAST_FMAL = 0, } - int __fpclassifyd(double); - int __fpclassifyf(float); - int __fpclassifyl(real); - int __isfinitef(float); - int __isfinite(double); - int __isfinitel(real); - int __isinff(float); - int __isinfl(real); - int __isnanl(real); - int __isnormalf(float); - int __isnormal(double); - int __isnormall(real); - int __signbit(double); - int __signbitf(float); - int __signbitl(real); + int __fpclassifyd(double); + int __fpclassifyf(float); + int __fpclassifyl(real); + int __isfinitef(float); + int __isfinite(double); + int __isfinitel(real); + int __isinff(float); + int __isinfl(real); + int __isnanl(real); + int __isnormalf(float); + int __isnormal(double); + int __isnormall(real); + int __signbit(double); + int __signbitf(float); + int __signbitl(real); extern (D) { //int fpclassify(real-floating x); int fpclassify(float x) { return __fpclassifyf(x); } int fpclassify(double x) { return __fpclassifyd(x); } - int fpclassify(real x) { return __fpclassifyl(x); } + int fpclassify(real x) { return __fpclassifyl(x); } //int isfinite(real-floating x); int isfinite(float x) { return __isfinitef(x); } int isfinite(double x) { return __isfinite(x); } - int isfinite(double x) { return __isfinitel(x); } + int isfinite(real x) { return __isfinitel(x); } //int isinf(real-floating x); int isinf(float x) { return __isinff(x); } int isinf(double x) { return __isinfl(x); } - int isinf(real x) { return __isinfl(x); } + int isinf(real x) { return __isinfl(x); } //int isnan(real-floating x); int isnan(float x) { return __isnanl(x); } int isnan(double x) { return __isnanl(x); } - int isnan(real x) { return __isnanl(x); } + int isnan(real x) { return __isnanl(x); } //int isnormal(real-floating x); int isnormal(float x) { return __isnormalf(x); } @@ -425,7 +425,7 @@ else version( freebsd ) //int signbit(real-floating x); int signbit(float x) { return __signbitf(x); } int signbit(double x) { return __signbit(x); } - int signbit(double x) { return __signbit(x); } + int signbit(real x) { return __signbit(x); } } } @@ -462,230 +462,467 @@ extern (D) int isunordered(real x, real y) { return (x !<>= y); } } -double acos(double x); -float acosf(float x); -real acosl(real x); +// NOTE: freebsd < 8-CURRENT doesn't appear to support *l, but we can +// approximate. +version( freebsd ) +{ + double acos(double x); + float acosf(float x); + real acosl(real x) { return acos(x); } + + double asin(double x); + float asinf(float x); + real asinl(real x) { return asin(x); } + + double atan(double x); + float atanf(float x); + real atanl(real x) { return atan(x); } + + double atan2(double y, double x); + float atan2f(float y, float x); + real atan2l(real y, real x) { return atan2(y, x); } + + double cos(double x); + float cosf(float x); + real cosl(real x) { return cos(x); } + + double sin(double x); + float sinf(float x); + real sinl(real x) { return sin(x); } + + double tan(double x); + float tanf(float x); + real tanl(real x) { return tan(x); } + + double acosh(double x); + float acoshf(float x); + real acoshl(real x) { return acosh(x); } + + double asinh(double x); + float asinhf(float x); + real asinhl(real x) { return asinh(x); } + + double atanh(double x); + float atanhf(float x); + real atanhl(real x) { return atanh(x); } + + double cosh(double x); + float coshf(float x); + real coshl(real x) { return cosh(x); } + + double sinh(double x); + float sinhf(float x); + real sinhl(real x) { return sinh(x); } + + double tanh(double x); + float tanhf(float x); + real tanhl(real x) { return tanh(x); } + + double exp(double x); + float expf(float x); + real expl(real x) { return exp(x); } + + double exp2(double x); + float exp2f(float x); + real exp2l(real x) { return exp2(x); } + + double expm1(double x); + float expm1f(float x); + real expm1l(real x) { return expm1(x); } + + double frexp(double value, int* exp); + float frexpf(float value, int* exp); + real frexpl(real value, int* exp) { return frexp(value, exp); } + + int ilogb(double x); + int ilogbf(float x); + int ilogbl(real x) { return ilogb(x); } + + double ldexp(double x, int exp); + float ldexpf(float x, int exp); + real ldexpl(real x, int exp) { return ldexp(x, exp); } + + double log(double x); + float logf(float x); + real logl(real x) { return log(x); } + + double log10(double x); + float log10f(float x); + real log10l(real x) { return log10(x); } + + double log1p(double x); + float log1pf(float x); + real log1pl(real x) { return log1p(x); } + + private const real ONE_LN2 = 1 / 0x1.62e42fefa39ef358p-1L; + double log2(double x) { return log(x) * ONE_LN2; } + float log2f(float x) { return logf(x) * ONE_LN2; } + real log2l(real x) { return logl(x) * ONE_LN2; } + + double logb(double x); + float logbf(float x); + real logbl(real x) { return logb(x); } + + double modf(double value, double* iptr); + float modff(float value, float* iptr); + //real modfl(real value, real *iptr); // nontrivial conversion + + double scalbn(double x, int n); + float scalbnf(float x, int n); + real scalbnl(real x, int n) { return scalbn(x, n); } + + double scalbln(double x, c_long n); + float scalblnf(float x, c_long n); + real scalblnl(real x, c_long n) { return scalbln(x, n); } + + + double cbrt(double x); + float cbrtf(float x); + real cbrtl(real x) { return cbrt(x); } + + double fabs(double x); + float fabsf(float x); + real fabsl(real x) { return fabs(x); } + + double hypot(double x, double y); + float hypotf(float x, float y); + real hypotl(real x, real y) { return hypot(x, y); } + + double pow(double x, double y); + float powf(float x, float y); + real powl(real x, real y) { return pow(x, y); } + + double sqrt(double x); + float sqrtf(float x); + real sqrtl(real x) { return sqrt(x); } + + double erf(double x); + float erff(float x); + real erfl(real x) { return erf(x); } + + double erfc(double x); + float erfcf(float x); + real erfcl(real x) { return erfc(x); } + + double lgamma(double x); + float lgammaf(float x); + real lgammal(real x) { return lgamma(x); } + + double tgamma(double x); + float tgammaf(float x); + real tgammal(real x) { return tgamma(x); } + + double ceil(double x); + float ceilf(float x); + real ceill(real x) { return ceil(x); } + + double floor(double x); + float floorf(float x); + real floorl(real x) { return floor(x); } + + double nearbyint(double x); + float nearbyintf(float x); + real nearbyintl(real x) { return nearbyint(x); } + + double rint(double x); + float rintf(float x); + real rintl(real x) { return rint(x); } + + c_long lrint(double x); + c_long lrintf(float x); + c_long lrintl(real x) { return lrint(x); } + + long llrint(double x); + long llrintf(float x); + long llrintl(real x) { return llrint(x); } + + double round(double x); + float roundf(float x); + real roundl(real x) { return round(x); } + + c_long lround(double x); + c_long lroundf(float x); + c_long lroundl(real x) { return lround(x); } + + long llround(double x); + long llroundf(float x); + long llroundl(real x) { return llround(x); } + + double trunc(double x); + float truncf(float x); + real truncl(real x) { return trunc(x); } + + double fmod(double x, double y); + float fmodf(float x, float y); + real fmodl(real x, real y) { return fmod(x, y); } + + double remainder(double x, double y); + float remainderf(float x, float y); + real remainderl(real x, real y) { return remainder(x, y); } + + double remquo(double x, double y, int* quo); + float remquof(float x, float y, int* quo); + real remquol(real x, real y, int* quo) { return remquo(x, y, quo); } + + double copysign(double x, double y); + float copysignf(float x, float y); + real copysignl(real x, real y) { return copysign(x, y); } + +// double nan(char* tagp); +// float nanf(char* tagp); +// real nanl(char* tagp); + + double nextafter(double x, double y); + float nextafterf(float x, float y); + real nextafterl(real x, real y) { return nextafter(x, y); } + + double nexttoward(double x, real y); + float nexttowardf(float x, real y); + real nexttowardl(real x, real y) { return nexttoward(x, y); } + + double fdim(double x, double y); + float fdimf(float x, float y); + real fdiml(real x, real y) { return fdim(x, y); } + + double fmax(double x, double y); + float fmaxf(float x, float y); + real fmaxl(real x, real y) { return fmax(x, y); } + + double fmin(double x, double y); + float fminf(float x, float y); + real fminl(real x, real y) { return fmin(x, y); } + + double fma(double x, double y, double z); + float fmaf(float x, float y, float z); + real fmal(real x, real y, real z) { return fma(x, y, z); } +} +else +{ + double acos(double x); + float acosf(float x); + real acosl(real x); -double asin(double x); -float asinf(float x); -real asinl(real x); + double asin(double x); + float asinf(float x); + real asinl(real x); -double atan(double x); -float atanf(float x); -real atanl(real x); + double atan(double x); + float atanf(float x); + real atanl(real x); -double atan2(double y, double x); -float atan2f(float y, float x); -real atan2l(real y, real x); + double atan2(double y, double x); + float atan2f(float y, float x); + real atan2l(real y, real x); -double cos(double x); -float cosf(float x); -real cosl(real x); + double cos(double x); + float cosf(float x); + real cosl(real x); -double sin(double x); -float sinf(float x); -real sinl(real x); + double sin(double x); + float sinf(float x); + real sinl(real x); -double tan(double x); -float tanf(float x); -real tanl(real x); + double tan(double x); + float tanf(float x); + real tanl(real x); -double acosh(double x); -float acoshf(float x); -real acoshl(real x); + double acosh(double x); + float acoshf(float x); + real acoshl(real x); -double asinh(double x); -float asinhf(float x); -real asinhl(real x); + double asinh(double x); + float asinhf(float x); + real asinhl(real x); -double atanh(double x); -float atanhf(float x); -real atanhl(real x); + double atanh(double x); + float atanhf(float x); + real atanhl(real x); -double cosh(double x); -float coshf(float x); -real coshl(real x); + double cosh(double x); + float coshf(float x); + real coshl(real x); -double sinh(double x); -float sinhf(float x); -real sinhl(real x); + double sinh(double x); + float sinhf(float x); + real sinhl(real x); -double tanh(double x); -float tanhf(float x); -real tanhl(real x); + double tanh(double x); + float tanhf(float x); + real tanhl(real x); -double exp(double x); -float expf(float x); -real expl(real x); + double exp(double x); + float expf(float x); + real expl(real x); -double exp2(double x); -float exp2f(float x); -real exp2l(real x); + double exp2(double x); + float exp2f(float x); + real exp2l(real x); -double expm1(double x); -float expm1f(float x); -real expm1l(real x); + double expm1(double x); + float expm1f(float x); + real expm1l(real x); -double frexp(double value, int* exp); -float frexpf(float value, int* exp); -real frexpl(real value, int* exp); + double frexp(double value, int* exp); + float frexpf(float value, int* exp); + real frexpl(real value, int* exp); -int ilogb(double x); -int ilogbf(float x); -int ilogbl(real x); + int ilogb(double x); + int ilogbf(float x); + int ilogbl(real x); -double ldexp(double x, int exp); -float ldexpf(float x, int exp); -real ldexpl(real x, int exp); + double ldexp(double x, int exp); + float ldexpf(float x, int exp); + real ldexpl(real x, int exp); -double log(double x); -float logf(float x); -real logl(real x); + double log(double x); + float logf(float x); + real logl(real x); -double log10(double x); -float log10f(float x); -real log10l(real x); + double log10(double x); + float log10f(float x); + real log10l(real x); -double log1p(double x); -float log1pf(float x); -real log1pl(real x); + double log1p(double x); + float log1pf(float x); + real log1pl(real x); -double log2(double x); -float log2f(float x); -real log2l(real x); + double log2(double x); + float log2f(float x); + real log2l(real x); -double logb(double x); -float logbf(float x); -real logbl(real x); + double logb(double x); + float logbf(float x); + real logbl(real x); -double modf(double value, double* iptr); -float modff(float value, float* iptr); -real modfl(real value, real *iptr); + double modf(double value, double* iptr); + float modff(float value, float* iptr); + real modfl(real value, real *iptr); -double scalbn(double x, int n); -float scalbnf(float x, int n); -real scalbnl(real x, int n); + double scalbn(double x, int n); + float scalbnf(float x, int n); + real scalbnl(real x, int n); -double scalbln(double x, c_long n); -float scalblnf(float x, c_long n); -real scalblnl(real x, c_long n); + double scalbln(double x, c_long n); + float scalblnf(float x, c_long n); + real scalblnl(real x, c_long n); -double cbrt(double x); -float cbrtf(float x); -real cbrtl(real x); + double cbrt(double x); + float cbrtf(float x); + real cbrtl(real x); -double fabs(double x); -float fabsf(float x); -real fabsl(real x); + double fabs(double x); + float fabsf(float x); + real fabsl(real x); -double hypot(double x, double y); -float hypotf(float x, float y); -real hypotl(real x, real y); + double hypot(double x, double y); + float hypotf(float x, float y); + real hypotl(real x, real y); -double pow(double x, double y); -float powf(float x, float y); -real powl(real x, real y); + double pow(double x, double y); + float powf(float x, float y); + real powl(real x, real y); -double sqrt(double x); -float sqrtf(float x); -real sqrtl(real x); + double sqrt(double x); + float sqrtf(float x); + real sqrtl(real x); -double erf(double x); -float erff(float x); -real erfl(real x); + double erf(double x); + float erff(float x); + real erfl(real x); -double erfc(double x); -float erfcf(float x); -real erfcl(real x); + double erfc(double x); + float erfcf(float x); + real erfcl(real x); -double lgamma(double x); -float lgammaf(float x); -real lgammal(real x); + double lgamma(double x); + float lgammaf(float x); + real lgammal(real x); -double tgamma(double x); -float tgammaf(float x); -real tgammal(real x); + double tgamma(double x); + float tgammaf(float x); + real tgammal(real x); -double ceil(double x); -float ceilf(float x); -real ceill(real x); + double ceil(double x); + float ceilf(float x); + real ceill(real x); -double floor(double x); -float floorf(float x); -real floorl(real x); + double floor(double x); + float floorf(float x); + real floorl(real x); -double nearbyint(double x); -float nearbyintf(float x); -real nearbyintl(real x); + double nearbyint(double x); + float nearbyintf(float x); + real nearbyintl(real x); -double rint(double x); -float rintf(float x); -real rintl(real x); + double rint(double x); + float rintf(float x); + real rintl(real x); -c_long lrint(double x); -c_long lrintf(float x); -c_long lrintl(real x); + c_long lrint(double x); + c_long lrintf(float x); + c_long lrintl(real x); -long llrint(double x); -long llrintf(float x); -long llrintl(real x); + long llrint(double x); + long llrintf(float x); + long llrintl(real x); -double round(double x); -float roundf(float x); -real roundl(real x); + double round(double x); + float roundf(float x); + real roundl(real x); -c_long lround(double x); -c_long lroundf(float x); -c_long lroundl(real x); + c_long lround(double x); + c_long lroundf(float x); + c_long lroundl(real x); -long llround(double x); -long llroundf(float x); -long llroundl(real x); + long llround(double x); + long llroundf(float x); + long llroundl(real x); -double trunc(double x); -float truncf(float x); -real truncl(real x); + double trunc(double x); + float truncf(float x); + real truncl(real x); -double fmod(double x, double y); -float fmodf(float x, float y); -real fmodl(real x, real y); + double fmod(double x, double y); + float fmodf(float x, float y); + real fmodl(real x, real y); -double remainder(double x, double y); -float remainderf(float x, float y); -real remainderl(real x, real y); + double remainder(double x, double y); + float remainderf(float x, float y); + real remainderl(real x, real y); -double remquo(double x, double y, int* quo); -float remquof(float x, float y, int* quo); -real remquol(real x, real y, int* quo); + double remquo(double x, double y, int* quo); + float remquof(float x, float y, int* quo); + real remquol(real x, real y, int* quo); -double copysign(double x, double y); -float copysignf(float x, float y); -real copysignl(real x, real y); + double copysign(double x, double y); + float copysignf(float x, float y); + real copysignl(real x, real y); -double nan(in char* tagp); -float nanf(in char* tagp); -real nanl(in char* tagp); + double nan(char* tagp); + float nanf(char* tagp); + real nanl(char* tagp); -double nextafter(double x, double y); -float nextafterf(float x, float y); -real nextafterl(real x, real y); + double nextafter(double x, double y); + float nextafterf(float x, float y); + real nextafterl(real x, real y); -double nexttoward(double x, real y); -float nexttowardf(float x, real y); -real nexttowardl(real x, real y); + double nexttoward(double x, real y); + float nexttowardf(float x, real y); + real nexttowardl(real x, real y); -double fdim(double x, double y); -float fdimf(float x, float y); -real fdiml(real x, real y); + double fdim(double x, double y); + float fdimf(float x, float y); + real fdiml(real x, real y); -double fmax(double x, double y); -float fmaxf(float x, float y); -real fmaxl(real x, real y); + double fmax(double x, double y); + float fmaxf(float x, float y); + real fmaxl(real x, real y); -double fmin(double x, double y); -float fminf(float x, float y); -real fminl(real x, real y); + double fmin(double x, double y); + float fminf(float x, float y); + real fminl(real x, real y); -double fma(double x, double y, double z); -float fmaf(float x, float y, float z); -real fmal(real x, real y, real z); + double fma(double x, double y, double z); + float fmaf(float x, float y, float z); + real fmal(real x, real y, real z); +} \ No newline at end of file diff --git a/import/stdc/posix/pthread.d b/import/stdc/posix/pthread.d index 2be0412..3b83ea0 100644 --- a/import/stdc/posix/pthread.d +++ b/import/stdc/posix/pthread.d @@ -384,6 +384,25 @@ else version( darwin ) int pthread_mutexattr_settype(pthread_mutexattr_t*, int); int pthread_setconcurrency(int); } +else version( freebsd ) +{ + enum + { + PTHREAD_MUTEX_ERRORCHECK = 1, + PTHREAD_MUTEX_RECURSIVE = 2, + PTHREAD_MUTEX_NORMAL = 3, + PTHREAD_MUTEX_ADAPTIVE_NP = 4, + PTHREAD_MUTEX_TYPE_MAX + } + const PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_ERRORCHECK; + + int pthread_attr_getguardsize(in pthread_attr_t*, size_t*); + int pthread_attr_setguardsize(pthread_attr_t*, size_t); + int pthread_getconcurrency(); + int pthread_mutexattr_gettype(pthread_mutexattr_t*, int*); + int pthread_mutexattr_settype(pthread_mutexattr_t*, int); + int pthread_setconcurrency(int); +} // // CPU Time (TCT) @@ -489,6 +508,24 @@ else version( darwin ) int pthread_setschedparam(pthread_t, int, in sched_param*); //int pthread_setschedprio(pthread_t, int); } +else version( freebsd ) +{ + enum + { + PTHREAD_SCOPE_PROCESS = 0, + PTHREAD_SCOPE_SYSTEM = 0x2 + } + + int pthread_attr_getinheritsched(in pthread_attr_t*, int*); + int pthread_attr_getschedpolicy(in pthread_attr_t*, int*); + int pthread_attr_getscope(in pthread_attr_t*, int*); + int pthread_attr_setinheritsched(pthread_attr_t*, int); + int pthread_attr_setschedpolicy(pthread_attr_t*, int); + int pthread_attr_setscope(in pthread_attr_t*, int); + int pthread_getschedparam(pthread_t, int*, sched_param*); + int pthread_setschedparam(pthread_t, int, sched_param*); + //int pthread_setschedprio(pthread_t, int); +} // // Stack (TSA|TSS) @@ -520,6 +557,15 @@ else version( darwin ) int pthread_attr_setstackaddr(pthread_attr_t*, void*); int pthread_attr_setstacksize(pthread_attr_t*, size_t); } +else version( freebsd ) +{ + int pthread_attr_getstack(in pthread_attr_t*, void**, size_t*); + int pthread_attr_getstackaddr(in pthread_attr_t*, void**); + int pthread_attr_getstacksize(in pthread_attr_t*, size_t*); + int pthread_attr_setstack(pthread_attr_t*, void*, size_t); + int pthread_attr_setstackaddr(pthread_attr_t*, void*); + int pthread_attr_setstacksize(pthread_attr_t*, size_t); +} // // Shared Synchronization (TSH) diff --git a/import/stdc/posix/semaphore.d b/import/stdc/posix/semaphore.d index b68f111..392a004 100644 --- a/import/stdc/posix/semaphore.d +++ b/import/stdc/posix/semaphore.d @@ -60,23 +60,8 @@ else version( freebsd ) { const uint SEM_MAGIC = 0x09fa4012; const SEM_USER = 0; - struct sem_t - { - uint magic; - pthread_mutex_t lock; - pthread_cond_t gtzero; - uint count; - uint nwaiters; - int semid; - int syssem; - struct _entry - { - sem* le_next; - sem** le_prev; - } - _entry entry; - sem_t** backpointer; - } + + alias void* sem_t; const SEM_FAILED = cast(sem_t*) null; } diff --git a/import/stdc/posix/signal.d b/import/stdc/posix/signal.d index dc1f88a..06cc469 100644 --- a/import/stdc/posix/signal.d +++ b/import/stdc/posix/signal.d @@ -150,7 +150,7 @@ else version( darwin ) } else version( freebsd ) { - //SIGABRT (defined in stdc.signal) + //SIGABRT (defined in stdc.signal) const SIGALRM = 14; const SIGBUS = 10; const SIGCHLD = 20; @@ -430,14 +430,6 @@ else version( darwin ) } else version( freebsd ) { - union sigval - { - int sival_int; - void* sival_ptr; - int sigval_int; - void* sigval_ptr; - } - struct sigset_t { uint __bits[4]; @@ -798,7 +790,28 @@ version( linux ) int sigtimedwait(in sigset_t*, siginfo_t*, in timespec*); int sigwaitinfo(in sigset_t*, siginfo_t*); } +else version( freebsd ) +{ + struct sigevent + { + int sigev_notify; + int sigev_signo; + sigval sigev_value; + union _sigev_un + { + lwpid_t _threadid; + struct _sigev_thread { + void function(sigval) _function; + void* _attribute; + } + c_long[8] __spare__; + } + } + int sigqueue(pid_t, int, in sigval); + int sigtimedwait(in sigset_t*, siginfo_t*, in timespec*); + int sigwaitinfo(in sigset_t*, siginfo_t*); +} // // Threads (THR) // diff --git a/import/stdc/posix/stdlib.d b/import/stdc/posix/stdlib.d index d9c7c62..e9b0ba2 100644 --- a/import/stdc/posix/stdlib.d +++ b/import/stdc/posix/stdlib.d @@ -101,6 +101,13 @@ else version( darwin ) void* valloc(size_t); // LEGACY non-standard } +else version( freebsd ) +{ + int setenv(in char*, in char*, int); + int unsetenv(in char*); + + void* valloc(size_t); // LEGACY non-standard +} // // Thread-Safe Functions (TSF) diff --git a/import/stdc/posix/sys/mman.d b/import/stdc/posix/sys/mman.d index f23e16a..9c37e75 100644 --- a/import/stdc/posix/sys/mman.d +++ b/import/stdc/posix/sys/mman.d @@ -172,7 +172,7 @@ else version( darwin ) int msync(void*, size_t, int); } -else version( darwin ) +else version( freebsd ) { const MAP_SHARED = 0x0001; const MAP_PRIVATE = 0x0002; diff --git a/import/stdc/posix/sys/stat.d b/import/stdc/posix/sys/stat.d index b2cc2bc..875a6b4 100644 --- a/import/stdc/posix/sys/stat.d +++ b/import/stdc/posix/sys/stat.d @@ -240,27 +240,39 @@ else version( freebsd ) { struct stat_t { - dev_t st_dev; - ino_t st_ino; - mode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - dev_t st_rdev; - time_t st_atime; - c_long st_atimensec; - time_t st_mtime; - c_long st_mtimensec; - time_t st_ctime; - c_long st_ctimensec; + dev_t st_dev; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + + timespec st_atimespec; + timespec st_mtimespec; + timespec st_ctimespec; + time_t st_atime() + { + return st_atimespec.tv_sec; + } + time_t st_mtime() + { + return st_mtimespec.tv_sec; + } + time_t st_ctime() + { + return st_ctimespec.tv_sec; + } + off_t st_size; blkcnt_t st_blocks; blksize_t st_blksize; - uint st_flags; + fflags_t st_flags; uint st_gen; int st_lspare; - time_t st_birthtime; - c_long st_birthtimensec; + timespec st_birthtimespec; + + byte[16 - timespec.sizeof] padding; } const S_IRUSR = 0000400; diff --git a/import/stdc/posix/sys/types.d b/import/stdc/posix/sys/types.d index 579f185..bd4dbd5 100644 --- a/import/stdc/posix/sys/types.d +++ b/import/stdc/posix/sys/types.d @@ -90,6 +90,7 @@ else version( freebsd ) alias size_t ssize_t; //time_t (defined in stdc.time) alias uint uid_t; + alias uint fflags_t; } // @@ -136,12 +137,12 @@ else version( darwin ) else version( freebsd ) { //clock_t - alias ulong fsblkcnt_t; - alias ulong fsfilcnt_t; - alias long id_t; - // key_t - alias c_long suseconds_t; // C long - alias uint useconds_t; // C unsigned int + alias ulong fsblkcnt_t; + alias ulong fsfilcnt_t; + alias long id_t; + alias c_long key_t; + alias c_long suseconds_t; + alias uint useconds_t; } // @@ -346,26 +347,18 @@ else version( darwin ) } else version( freebsd ) { - struct pthread; - - /* - - { - - c_long tid; - umutex lock; - umtx_t cycle; - int locklevel; // C int - int critical_count; // C int - int sigblock; // C int - TAILQ_ENTRY(pthread) tle; - TAILQ_ENTRY(pthread) gcle; - LIST_ENTRY(pthread) hle; - int refcount; // C int - } - */ - - alias pthread* pthread_t; + alias int lwpid_t; + + alias void* pthread_attr_t; + alias void* pthread_cond_t; + alias void* pthread_condattr_t; + alias void* pthread_key_t; + alias void* pthread_mutex_t; + alias void* pthread_mutexattr_t; + alias void* pthread_once_t; + alias void* pthread_rwlock_t; + alias void* pthread_rwlockattr_t; + alias void* pthread_t; } // @@ -393,22 +386,8 @@ version( linux ) } else version( freebsd ) { - struct pthread_barrier { - umutex b_lock; - ucond b_cv; - long b_cycle; // volatile - int b_count; // volatile C int - int b_waiters; // volatile C int - } - - alias pthread_barrier* pthread_barrier_t; - - struct pthread_barrierattr - { - int pshared; - } - - alias pthread_barrierattr* pthread_barrierattr_t; + alias void* pthread_barrier_t; + alias void* pthread_barrierattr_t; } // @@ -428,9 +407,7 @@ else version( darwin ) } else version( freebsd ) { - private struct pthread_spinlock; - - alias pthread_spinlock* pthread_spinlock_t; + alias void* pthread_spinlock_t; } // diff --git a/import/stdc/posix/termios.d b/import/stdc/posix/termios.d index da070a1..9d96c06 100644 --- a/import/stdc/posix/termios.d +++ b/import/stdc/posix/termios.d @@ -122,7 +122,7 @@ int tcsendbreak(int, int); int tcsetattr(int, int, in termios*); */ -version ( darwin) +version( darwin ) { alias ubyte cc_t; alias uint speed_t; @@ -231,8 +231,7 @@ version ( darwin) int tcsetattr(int, int, in termios*); } - -version( linux ) +else version( linux ) { alias ubyte cc_t; alias uint speed_t; @@ -341,6 +340,115 @@ version( linux ) int tcsendbreak(int, int); int tcsetattr(int, int, in termios*); } +else version ( freebsd ) +{ + alias ubyte cc_t; + alias uint speed_t; + alias uint tcflag_t; + + const NCCS = 20; + + struct termios + { + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + cc_t[NCCS] c_cc; + speed_t c_ispeed; + speed_t c_ospeed; + } + + const VEOF = 0; + const VEOL = 1; + const VERASE = 3; + const VINTR = 8; + const VKILL = 5; + const VMIN = 16; + const VQUIT = 9; + const VSTART = 12; + const VSTOP = 13; + const VSUSP = 10; + const VTIME = 17; + + const BRKINT = 0x0000002; + const ICRNL = 0x0000100; + const IGNBRK = 0x0000001; + const IGNCR = 0x0000080; + const IGNPAR = 0x0000004; + const INLCR = 0x0000040; + const INPCK = 0x0000010; + const ISTRIP = 0x0000020; + const IXOFF = 0x0000400; + const IXON = 0x0000200; + const PARMRK = 0x0000008; + + const OPOST = 0x0000001; + + const B0 = 0; + const B50 = 50; + const B75 = 75; + const B110 = 110; + const B134 = 134; + const B150 = 150; + const B200 = 200; + const B300 = 300; + const B600 = 600; + const B1200 = 1200; + const B1800 = 1800; + const B2400 = 2400; + const B4800 = 4800; + const B9600 = 9600; + const B19200 = 19200; + const B38400 = 38400; + + const CSIZE = 0x0000300; + const CS5 = 0x0000000; + const CS6 = 0x0000100; + const CS7 = 0x0000200; + const CS8 = 0x0000300; + const CSTOPB = 0x0000400; + const CREAD = 0x0000800; + const PARENB = 0x0001000; + const PARODD = 0x0002000; + const HUPCL = 0x0004000; + const CLOCAL = 0x0008000; + + const ECHO = 0x00000008; + const ECHOE = 0x00000002; + const ECHOK = 0x00000004; + const ECHONL = 0x00000010; + const ICANON = 0x00000100; + const IEXTEN = 0x00000400; + const ISIG = 0x00000080; + const NOFLSH = 0x80000000; + const TOSTOP = 0x00400000; + + const TCSANOW = 0; + const TCSADRAIN = 1; + const TCSAFLUSH = 2; + + const TCIFLUSH = 1; + const TCOFLUSH = 2; + const TCIOFLUSH = 3; + + const TCIOFF = 3; + const TCION = 4; + const TCOOFF = 1; + const TCOON = 2; + + speed_t cfgetispeed(in termios*); + speed_t cfgetospeed(in termios*); + int cfsetispeed(termios*, speed_t); + int cfsetospeed(termios*, speed_t); + int tcdrain(int); + int tcflow(int, int); + int tcflush(int, int); + int tcgetattr(int, termios*); + int tcsendbreak(int, int); + int tcsetattr(int, int, in termios*); + +} // // XOpen (XSI) diff --git a/import/stdc/posix/time.d b/import/stdc/posix/time.d index 0c77b08..7d52f1d 100644 --- a/import/stdc/posix/time.d +++ b/import/stdc/posix/time.d @@ -250,6 +250,8 @@ else version( darwin ) } else version( freebsd ) { + extern c_long timezone; + //tm* getdate(in char*); char* strptime(in char*, in char*, tm*); } diff --git a/import/stdc/posix/unistd.d b/import/stdc/posix/unistd.d index a40472d..107f0d4 100644 --- a/import/stdc/posix/unistd.d +++ b/import/stdc/posix/unistd.d @@ -102,6 +102,11 @@ version( linux ) int ftruncate(int, off_t); } } +else version( freebsd ) +{ + off_t lseek(int, off_t, int); + int ftruncate(int, off_t); +} else { off_t lseek(int, off_t, int); diff --git a/import/stdc/tgmath.d b/import/stdc/tgmath.d index 5ace9c5..c6a3dc3 100644 --- a/import/stdc/tgmath.d +++ b/import/stdc/tgmath.d @@ -14,318 +14,639 @@ private static import stdc.complex; extern (C): -alias stdc.math.acos acos; -alias stdc.math.acosf acos; -alias stdc.math.acosl acos; +version( freebsd ) +{ + alias stdc.math.acos acos; + alias stdc.math.acosf acos; + alias stdc.math.acosl acos; -alias stdc.complex.cacos acos; -alias stdc.complex.cacosf acos; -alias stdc.complex.cacosl acos; + alias stdc.complex.cacos acos; + alias stdc.complex.cacosf acos; + alias stdc.complex.cacosl acos; -alias stdc.math.asin asin; -alias stdc.math.asinf asin; -alias stdc.math.asinl asin; + alias stdc.math.asin asin; + alias stdc.math.asinf asin; + alias stdc.math.asinl asin; -alias stdc.complex.casin asin; -alias stdc.complex.casinf asin; -alias stdc.complex.casinl asin; + alias stdc.complex.casin asin; + alias stdc.complex.casinf asin; + alias stdc.complex.casinl asin; -alias stdc.math.atan atan; -alias stdc.math.atanf atan; -alias stdc.math.atanl atan; + alias stdc.math.atan atan; + alias stdc.math.atanf atan; + alias stdc.math.atanl atan; -alias stdc.complex.catan atan; -alias stdc.complex.catanf atan; -alias stdc.complex.catanl atan; + alias stdc.complex.catan atan; + alias stdc.complex.catanf atan; + alias stdc.complex.catanl atan; -alias stdc.math.atan2 atan2; -alias stdc.math.atan2f atan2; -alias stdc.math.atan2l atan2; + alias stdc.math.atan2 atan2; + alias stdc.math.atan2f atan2; + alias stdc.math.atan2l atan2; -alias stdc.math.cos cos; -alias stdc.math.cosf cos; -alias stdc.math.cosl cos; + alias stdc.math.cos cos; + alias stdc.math.cosf cos; + alias stdc.math.cosl cos; -alias stdc.complex.ccos cos; -alias stdc.complex.ccosf cos; -alias stdc.complex.ccosl cos; + alias stdc.complex.ccos cos; + alias stdc.complex.ccosf cos; + alias stdc.complex.ccosl cos; -alias stdc.math.sin sin; -alias stdc.math.sinf sin; -alias stdc.math.sinl sin; + alias stdc.math.sin sin; + alias stdc.math.sinf sin; + alias stdc.math.sinl sin; -alias stdc.complex.csin csin; -alias stdc.complex.csinf csin; -alias stdc.complex.csinl csin; + alias stdc.complex.csin csin; + alias stdc.complex.csinf csin; + alias stdc.complex.csinl csin; -alias stdc.math.tan tan; -alias stdc.math.tanf tan; -alias stdc.math.tanl tan; + alias stdc.math.tan tan; + alias stdc.math.tanf tan; + alias stdc.math.tanl tan; -alias stdc.complex.ctan tan; -alias stdc.complex.ctanf tan; -alias stdc.complex.ctanl tan; + alias stdc.complex.ctan tan; + alias stdc.complex.ctanf tan; + alias stdc.complex.ctanl tan; -alias stdc.math.acosh acosh; -alias stdc.math.acoshf acosh; -alias stdc.math.acoshl acosh; + alias stdc.math.acosh acosh; + alias stdc.math.acoshf acosh; + alias stdc.math.acoshl acosh; -alias stdc.complex.cacosh acosh; -alias stdc.complex.cacoshf acosh; -alias stdc.complex.cacoshl acosh; + alias stdc.complex.cacosh acosh; + alias stdc.complex.cacoshf acosh; + alias stdc.complex.cacoshl acosh; -alias stdc.math.asinh asinh; -alias stdc.math.asinhf asinh; -alias stdc.math.asinhl asinh; + alias stdc.math.asinh asinh; + alias stdc.math.asinhf asinh; + alias stdc.math.asinhl asinh; -alias stdc.complex.casinh asinh; -alias stdc.complex.casinhf asinh; -alias stdc.complex.casinhl asinh; + alias stdc.complex.casinh asinh; + alias stdc.complex.casinhf asinh; + alias stdc.complex.casinhl asinh; -alias stdc.math.atanh atanh; -alias stdc.math.atanhf atanh; -alias stdc.math.atanhl atanh; + alias stdc.math.atanh atanh; + alias stdc.math.atanhf atanh; + alias stdc.math.atanhl atanh; -alias stdc.complex.catanh atanh; -alias stdc.complex.catanhf atanh; -alias stdc.complex.catanhl atanh; + alias stdc.complex.catanh atanh; + alias stdc.complex.catanhf atanh; + alias stdc.complex.catanhl atanh; -alias stdc.math.cosh cosh; -alias stdc.math.coshf cosh; -alias stdc.math.coshl cosh; + alias stdc.math.cosh cosh; + alias stdc.math.coshf cosh; + alias stdc.math.coshl cosh; -alias stdc.complex.ccosh cosh; -alias stdc.complex.ccoshf cosh; -alias stdc.complex.ccoshl cosh; + alias stdc.complex.ccosh cosh; + alias stdc.complex.ccoshf cosh; + alias stdc.complex.ccoshl cosh; -alias stdc.math.sinh sinh; -alias stdc.math.sinhf sinh; -alias stdc.math.sinhl sinh; + alias stdc.math.sinh sinh; + alias stdc.math.sinhf sinh; + alias stdc.math.sinhl sinh; -alias stdc.complex.csinh sinh; -alias stdc.complex.csinhf sinh; -alias stdc.complex.csinhl sinh; + alias stdc.complex.csinh sinh; + alias stdc.complex.csinhf sinh; + alias stdc.complex.csinhl sinh; -alias stdc.math.tanh tanh; -alias stdc.math.tanhf tanh; -alias stdc.math.tanhl tanh; + alias stdc.math.tanh tanh; + alias stdc.math.tanhf tanh; + alias stdc.math.tanhl tanh; -alias stdc.complex.ctanh tanh; -alias stdc.complex.ctanhf tanh; -alias stdc.complex.ctanhl tanh; + alias stdc.complex.ctanh tanh; + alias stdc.complex.ctanhf tanh; + alias stdc.complex.ctanhl tanh; -alias stdc.math.exp exp; -alias stdc.math.expf exp; -alias stdc.math.expl exp; + alias stdc.math.exp exp; + alias stdc.math.expf exp; + alias stdc.math.expl exp; -alias stdc.complex.cexp exp; -alias stdc.complex.cexpf exp; -alias stdc.complex.cexpl exp; + alias stdc.complex.cexp exp; + alias stdc.complex.cexpf exp; + alias stdc.complex.cexpl exp; -alias stdc.math.exp2 exp2; -alias stdc.math.exp2f exp2; -alias stdc.math.exp2l exp2; + alias stdc.math.exp2 exp2; + alias stdc.math.exp2f exp2; + alias stdc.math.exp2l exp2; -alias stdc.math.expm1 expm1; -alias stdc.math.expm1f expm1; -alias stdc.math.expm1l expm1; + alias stdc.math.expm1 expm1; + alias stdc.math.expm1f expm1; + alias stdc.math.expm1l expm1; -alias stdc.math.frexp frexp; -alias stdc.math.frexpf frexp; -alias stdc.math.frexpl frexp; + alias stdc.math.frexp frexp; + alias stdc.math.frexpf frexp; + alias stdc.math.frexpl frexp; -alias stdc.math.ilogb ilogb; -alias stdc.math.ilogbf ilogb; -alias stdc.math.ilogbl ilogb; + alias stdc.math.ilogb ilogb; + alias stdc.math.ilogbf ilogb; + alias stdc.math.ilogbl ilogb; -alias stdc.math.ldexp ldexp; -alias stdc.math.ldexpf ldexp; -alias stdc.math.ldexpl ldexp; + alias stdc.math.ldexp ldexp; + alias stdc.math.ldexpf ldexp; + alias stdc.math.ldexpl ldexp; -alias stdc.math.log log; -alias stdc.math.logf log; -alias stdc.math.logl log; + alias stdc.math.log log; + alias stdc.math.logf log; + alias stdc.math.logl log; -alias stdc.complex.clog log; -alias stdc.complex.clogf log; -alias stdc.complex.clogl log; + alias stdc.complex.clog log; + alias stdc.complex.clogf log; + alias stdc.complex.clogl log; -alias stdc.math.log10 log10; -alias stdc.math.log10f log10; -alias stdc.math.log10l log10; + alias stdc.math.log10 log10; + alias stdc.math.log10f log10; + alias stdc.math.log10l log10; -alias stdc.math.log1p log1p; -alias stdc.math.log1pf log1p; -alias stdc.math.log1pl log1p; + alias stdc.math.log1p log1p; + alias stdc.math.log1pf log1p; + alias stdc.math.log1pl log1p; -alias stdc.math.log2 log1p; -alias stdc.math.log2f log1p; -alias stdc.math.log2l log1p; + alias stdc.math.log2 log1p; + alias stdc.math.log2f log1p; + alias stdc.math.log2l log1p; -alias stdc.math.logb log1p; -alias stdc.math.logbf log1p; -alias stdc.math.logbl log1p; + alias stdc.math.logb log1p; + alias stdc.math.logbf log1p; + alias stdc.math.logbl log1p; -alias stdc.math.modf modf; -alias stdc.math.modff modf; -alias stdc.math.modfl modf; + alias stdc.math.modf modf; + alias stdc.math.modff modf; +// alias stdc.math.modfl modf; -alias stdc.math.scalbn scalbn; -alias stdc.math.scalbnf scalbn; -alias stdc.math.scalbnl scalbn; + alias stdc.math.scalbn scalbn; + alias stdc.math.scalbnf scalbn; + alias stdc.math.scalbnl scalbn; -alias stdc.math.scalbln scalbln; -alias stdc.math.scalblnf scalbln; -alias stdc.math.scalblnl scalbln; + alias stdc.math.scalbln scalbln; + alias stdc.math.scalblnf scalbln; + alias stdc.math.scalblnl scalbln; -alias stdc.math.cbrt cbrt; -alias stdc.math.cbrtf cbrt; -alias stdc.math.cbrtl cbrt; + alias stdc.math.cbrt cbrt; + alias stdc.math.cbrtf cbrt; + alias stdc.math.cbrtl cbrt; -alias stdc.math.fabs fabs; -alias stdc.math.fabsf fabs; -alias stdc.math.fabsl fabs; + alias stdc.math.fabs fabs; + alias stdc.math.fabsf fabs; + alias stdc.math.fabsl fabs; -alias stdc.complex.cabs fabs; -alias stdc.complex.cabsf fabs; -alias stdc.complex.cabsl fabs; + alias stdc.complex.cabs fabs; + alias stdc.complex.cabsf fabs; + alias stdc.complex.cabsl fabs; -alias stdc.math.hypot hypot; -alias stdc.math.hypotf hypot; -alias stdc.math.hypotl hypot; + alias stdc.math.hypot hypot; + alias stdc.math.hypotf hypot; + alias stdc.math.hypotl hypot; -alias stdc.math.pow pow; -alias stdc.math.powf pow; -alias stdc.math.powl pow; + alias stdc.math.pow pow; + alias stdc.math.powf pow; + alias stdc.math.powl pow; -alias stdc.complex.cpow pow; -alias stdc.complex.cpowf pow; -alias stdc.complex.cpowl pow; + alias stdc.complex.cpow pow; + alias stdc.complex.cpowf pow; + alias stdc.complex.cpowl pow; -alias stdc.math.sqrt sqrt; -alias stdc.math.sqrtf sqrt; -alias stdc.math.sqrtl sqrt; + alias stdc.math.sqrt sqrt; + alias stdc.math.sqrtf sqrt; + alias stdc.math.sqrtl sqrt; -alias stdc.complex.csqrt sqrt; -alias stdc.complex.csqrtf sqrt; -alias stdc.complex.csqrtl sqrt; + alias stdc.complex.csqrt sqrt; + alias stdc.complex.csqrtf sqrt; + alias stdc.complex.csqrtl sqrt; -alias stdc.math.erf erf; -alias stdc.math.erff erf; -alias stdc.math.erfl erf; + alias stdc.math.erf erf; + alias stdc.math.erff erf; + alias stdc.math.erfl erf; -alias stdc.math.erfc erfc; -alias stdc.math.erfcf erfc; -alias stdc.math.erfcl erfc; + alias stdc.math.erfc erfc; + alias stdc.math.erfcf erfc; + alias stdc.math.erfcl erfc; -alias stdc.math.lgamma lgamma; -alias stdc.math.lgammaf lgamma; -alias stdc.math.lgammal lgamma; + alias stdc.math.lgamma lgamma; + alias stdc.math.lgammaf lgamma; + alias stdc.math.lgammal lgamma; -alias stdc.math.tgamma tgamma; -alias stdc.math.tgammaf tgamma; -alias stdc.math.tgammal tgamma; + alias stdc.math.tgamma tgamma; + alias stdc.math.tgammaf tgamma; + alias stdc.math.tgammal tgamma; -alias stdc.math.ceil ceil; -alias stdc.math.ceilf ceil; -alias stdc.math.ceill ceil; + alias stdc.math.ceil ceil; + alias stdc.math.ceilf ceil; + alias stdc.math.ceill ceil; -alias stdc.math.floor floor; -alias stdc.math.floorf floor; -alias stdc.math.floorl floor; + alias stdc.math.floor floor; + alias stdc.math.floorf floor; + alias stdc.math.floorl floor; + + alias stdc.math.nearbyint nearbyint; + alias stdc.math.nearbyintf nearbyint; + alias stdc.math.nearbyintl nearbyint; + + alias stdc.math.rint rint; + alias stdc.math.rintf rint; + alias stdc.math.rintl rint; + + alias stdc.math.lrint lrint; + alias stdc.math.lrintf lrint; + alias stdc.math.lrintl lrint; + + alias stdc.math.llrint llrint; + alias stdc.math.llrintf llrint; + alias stdc.math.llrintl llrint; + + alias stdc.math.round round; + alias stdc.math.roundf round; + alias stdc.math.roundl round; + + alias stdc.math.lround lround; + alias stdc.math.lroundf lround; + alias stdc.math.lroundl lround; + + alias stdc.math.llround llround; + alias stdc.math.llroundf llround; + alias stdc.math.llroundl llround; + + alias stdc.math.trunc trunc; + alias stdc.math.truncf trunc; + alias stdc.math.truncl trunc; + + alias stdc.math.fmod fmod; + alias stdc.math.fmodf fmod; + alias stdc.math.fmodl fmod; + + alias stdc.math.remainder remainder; + alias stdc.math.remainderf remainder; + alias stdc.math.remainderl remainder; + + alias stdc.math.remquo remquo; + alias stdc.math.remquof remquo; + alias stdc.math.remquol remquo; + + alias stdc.math.copysign copysign; + alias stdc.math.copysignf copysign; + alias stdc.math.copysignl copysign; + +// alias stdc.math.nan nan; +// alias stdc.math.nanf nan; +// alias stdc.math.nanl nan; + + alias stdc.math.nextafter nextafter; + alias stdc.math.nextafterf nextafter; + alias stdc.math.nextafterl nextafter; + + alias stdc.math.nexttoward nexttoward; + alias stdc.math.nexttowardf nexttoward; + alias stdc.math.nexttowardl nexttoward; + + alias stdc.math.fdim fdim; + alias stdc.math.fdimf fdim; + alias stdc.math.fdiml fdim; + + alias stdc.math.fmax fmax; + alias stdc.math.fmaxf fmax; + alias stdc.math.fmaxl fmax; + + alias stdc.math.fmin fmin; + alias stdc.math.fmin fmin; + alias stdc.math.fminl fmin; + + alias stdc.math.fma fma; + alias stdc.math.fmaf fma; + alias stdc.math.fmal fma; + + alias stdc.complex.carg carg; + alias stdc.complex.cargf carg; + alias stdc.complex.cargl carg; + + alias stdc.complex.cimag cimag; + alias stdc.complex.cimagf cimag; + alias stdc.complex.cimagl cimag; + + alias stdc.complex.conj conj; + alias stdc.complex.conjf conj; + alias stdc.complex.conjl conj; + + alias stdc.complex.cproj cproj; + alias stdc.complex.cprojf cproj; + alias stdc.complex.cprojl cproj; + +// alias stdc.complex.creal creal; +// alias stdc.complex.crealf creal; +// alias stdc.complex.creall creal; +} +else +{ + alias stdc.math.acos acos; + alias stdc.math.acosf acos; + alias stdc.math.acosl acos; + + alias stdc.complex.cacos acos; + alias stdc.complex.cacosf acos; + alias stdc.complex.cacosl acos; + + alias stdc.math.asin asin; + alias stdc.math.asinf asin; + alias stdc.math.asinl asin; + + alias stdc.complex.casin asin; + alias stdc.complex.casinf asin; + alias stdc.complex.casinl asin; + + alias stdc.math.atan atan; + alias stdc.math.atanf atan; + alias stdc.math.atanl atan; + + alias stdc.complex.catan atan; + alias stdc.complex.catanf atan; + alias stdc.complex.catanl atan; + + alias stdc.math.atan2 atan2; + alias stdc.math.atan2f atan2; + alias stdc.math.atan2l atan2; + + alias stdc.math.cos cos; + alias stdc.math.cosf cos; + alias stdc.math.cosl cos; + + alias stdc.complex.ccos cos; + alias stdc.complex.ccosf cos; + alias stdc.complex.ccosl cos; + + alias stdc.math.sin sin; + alias stdc.math.sinf sin; + alias stdc.math.sinl sin; + + alias stdc.complex.csin csin; + alias stdc.complex.csinf csin; + alias stdc.complex.csinl csin; + + alias stdc.math.tan tan; + alias stdc.math.tanf tan; + alias stdc.math.tanl tan; + + alias stdc.complex.ctan tan; + alias stdc.complex.ctanf tan; + alias stdc.complex.ctanl tan; + + alias stdc.math.acosh acosh; + alias stdc.math.acoshf acosh; + alias stdc.math.acoshl acosh; + + alias stdc.complex.cacosh acosh; + alias stdc.complex.cacoshf acosh; + alias stdc.complex.cacoshl acosh; + + alias stdc.math.asinh asinh; + alias stdc.math.asinhf asinh; + alias stdc.math.asinhl asinh; + + alias stdc.complex.casinh asinh; + alias stdc.complex.casinhf asinh; + alias stdc.complex.casinhl asinh; + + alias stdc.math.atanh atanh; + alias stdc.math.atanhf atanh; + alias stdc.math.atanhl atanh; + + alias stdc.complex.catanh atanh; + alias stdc.complex.catanhf atanh; + alias stdc.complex.catanhl atanh; + + alias stdc.math.cosh cosh; + alias stdc.math.coshf cosh; + alias stdc.math.coshl cosh; + + alias stdc.complex.ccosh cosh; + alias stdc.complex.ccoshf cosh; + alias stdc.complex.ccoshl cosh; + + alias stdc.math.sinh sinh; + alias stdc.math.sinhf sinh; + alias stdc.math.sinhl sinh; + + alias stdc.complex.csinh sinh; + alias stdc.complex.csinhf sinh; + alias stdc.complex.csinhl sinh; + + alias stdc.math.tanh tanh; + alias stdc.math.tanhf tanh; + alias stdc.math.tanhl tanh; + + alias stdc.complex.ctanh tanh; + alias stdc.complex.ctanhf tanh; + alias stdc.complex.ctanhl tanh; -alias stdc.math.nearbyint nearbyint; -alias stdc.math.nearbyintf nearbyint; -alias stdc.math.nearbyintl nearbyint; + alias stdc.math.exp exp; + alias stdc.math.expf exp; + alias stdc.math.expl exp; -alias stdc.math.rint rint; -alias stdc.math.rintf rint; -alias stdc.math.rintl rint; + alias stdc.complex.cexp exp; + alias stdc.complex.cexpf exp; + alias stdc.complex.cexpl exp; -alias stdc.math.lrint lrint; -alias stdc.math.lrintf lrint; -alias stdc.math.lrintl lrint; + alias stdc.math.exp2 exp2; + alias stdc.math.exp2f exp2; + alias stdc.math.exp2l exp2; -alias stdc.math.llrint llrint; -alias stdc.math.llrintf llrint; -alias stdc.math.llrintl llrint; + alias stdc.math.expm1 expm1; + alias stdc.math.expm1f expm1; + alias stdc.math.expm1l expm1; -alias stdc.math.round round; -alias stdc.math.roundf round; -alias stdc.math.roundl round; + alias stdc.math.frexp frexp; + alias stdc.math.frexpf frexp; + alias stdc.math.frexpl frexp; -alias stdc.math.lround lround; -alias stdc.math.lroundf lround; -alias stdc.math.lroundl lround; + alias stdc.math.ilogb ilogb; + alias stdc.math.ilogbf ilogb; + alias stdc.math.ilogbl ilogb; -alias stdc.math.llround llround; -alias stdc.math.llroundf llround; -alias stdc.math.llroundl llround; + alias stdc.math.ldexp ldexp; + alias stdc.math.ldexpf ldexp; + alias stdc.math.ldexpl ldexp; -alias stdc.math.trunc trunc; -alias stdc.math.truncf trunc; -alias stdc.math.truncl trunc; + alias stdc.math.log log; + alias stdc.math.logf log; + alias stdc.math.logl log; -alias stdc.math.fmod fmod; -alias stdc.math.fmodf fmod; -alias stdc.math.fmodl fmod; + alias stdc.complex.clog log; + alias stdc.complex.clogf log; + alias stdc.complex.clogl log; -alias stdc.math.remainder remainder; -alias stdc.math.remainderf remainder; -alias stdc.math.remainderl remainder; + alias stdc.math.log10 log10; + alias stdc.math.log10f log10; + alias stdc.math.log10l log10; -alias stdc.math.remquo remquo; -alias stdc.math.remquof remquo; -alias stdc.math.remquol remquo; + alias stdc.math.log1p log1p; + alias stdc.math.log1pf log1p; + alias stdc.math.log1pl log1p; -alias stdc.math.copysign copysign; -alias stdc.math.copysignf copysign; -alias stdc.math.copysignl copysign; + alias stdc.math.log2 log1p; + alias stdc.math.log2f log1p; + alias stdc.math.log2l log1p; -alias stdc.math.nan nan; -alias stdc.math.nanf nan; -alias stdc.math.nanl nan; + alias stdc.math.logb log1p; + alias stdc.math.logbf log1p; + alias stdc.math.logbl log1p; -alias stdc.math.nextafter nextafter; -alias stdc.math.nextafterf nextafter; -alias stdc.math.nextafterl nextafter; + alias stdc.math.modf modf; + alias stdc.math.modff modf; + alias stdc.math.modfl modf; -alias stdc.math.nexttoward nexttoward; -alias stdc.math.nexttowardf nexttoward; -alias stdc.math.nexttowardl nexttoward; + alias stdc.math.scalbn scalbn; + alias stdc.math.scalbnf scalbn; + alias stdc.math.scalbnl scalbn; -alias stdc.math.fdim fdim; -alias stdc.math.fdimf fdim; -alias stdc.math.fdiml fdim; + alias stdc.math.scalbln scalbln; + alias stdc.math.scalblnf scalbln; + alias stdc.math.scalblnl scalbln; -alias stdc.math.fmax fmax; -alias stdc.math.fmaxf fmax; -alias stdc.math.fmaxl fmax; + alias stdc.math.cbrt cbrt; + alias stdc.math.cbrtf cbrt; + alias stdc.math.cbrtl cbrt; -alias stdc.math.fmin fmin; -alias stdc.math.fmin fmin; -alias stdc.math.fminl fmin; + alias stdc.math.fabs fabs; + alias stdc.math.fabsf fabs; + alias stdc.math.fabsl fabs; -alias stdc.math.fma fma; -alias stdc.math.fmaf fma; -alias stdc.math.fmal fma; + alias stdc.complex.cabs fabs; + alias stdc.complex.cabsf fabs; + alias stdc.complex.cabsl fabs; -alias stdc.complex.carg carg; -alias stdc.complex.cargf carg; -alias stdc.complex.cargl carg; + alias stdc.math.hypot hypot; + alias stdc.math.hypotf hypot; + alias stdc.math.hypotl hypot; -alias stdc.complex.cimag cimag; -alias stdc.complex.cimagf cimag; -alias stdc.complex.cimagl cimag; + alias stdc.math.pow pow; + alias stdc.math.powf pow; + alias stdc.math.powl pow; -alias stdc.complex.conj conj; -alias stdc.complex.conjf conj; -alias stdc.complex.conjl conj; + alias stdc.complex.cpow pow; + alias stdc.complex.cpowf pow; + alias stdc.complex.cpowl pow; -alias stdc.complex.cproj cproj; -alias stdc.complex.cprojf cproj; -alias stdc.complex.cprojl cproj; + alias stdc.math.sqrt sqrt; + alias stdc.math.sqrtf sqrt; + alias stdc.math.sqrtl sqrt; -//alias stdc.complex.creal creal; -//alias stdc.complex.crealf creal; -//alias stdc.complex.creall creal; + alias stdc.complex.csqrt sqrt; + alias stdc.complex.csqrtf sqrt; + alias stdc.complex.csqrtl sqrt; + + alias stdc.math.erf erf; + alias stdc.math.erff erf; + alias stdc.math.erfl erf; + + alias stdc.math.erfc erfc; + alias stdc.math.erfcf erfc; + alias stdc.math.erfcl erfc; + + alias stdc.math.lgamma lgamma; + alias stdc.math.lgammaf lgamma; + alias stdc.math.lgammal lgamma; + + alias stdc.math.tgamma tgamma; + alias stdc.math.tgammaf tgamma; + alias stdc.math.tgammal tgamma; + + alias stdc.math.ceil ceil; + alias stdc.math.ceilf ceil; + alias stdc.math.ceill ceil; + + alias stdc.math.floor floor; + alias stdc.math.floorf floor; + alias stdc.math.floorl floor; + + alias stdc.math.nearbyint nearbyint; + alias stdc.math.nearbyintf nearbyint; + alias stdc.math.nearbyintl nearbyint; + + alias stdc.math.rint rint; + alias stdc.math.rintf rint; + alias stdc.math.rintl rint; + + alias stdc.math.lrint lrint; + alias stdc.math.lrintf lrint; + alias stdc.math.lrintl lrint; + + alias stdc.math.llrint llrint; + alias stdc.math.llrintf llrint; + alias stdc.math.llrintl llrint; + + alias stdc.math.round round; + alias stdc.math.roundf round; + alias stdc.math.roundl round; + + alias stdc.math.lround lround; + alias stdc.math.lroundf lround; + alias stdc.math.lroundl lround; + + alias stdc.math.llround llround; + alias stdc.math.llroundf llround; + alias stdc.math.llroundl llround; + + alias stdc.math.trunc trunc; + alias stdc.math.truncf trunc; + alias stdc.math.truncl trunc; + + alias stdc.math.fmod fmod; + alias stdc.math.fmodf fmod; + alias stdc.math.fmodl fmod; + + alias stdc.math.remainder remainder; + alias stdc.math.remainderf remainder; + alias stdc.math.remainderl remainder; + + alias stdc.math.remquo remquo; + alias stdc.math.remquof remquo; + alias stdc.math.remquol remquo; + + alias stdc.math.copysign copysign; + alias stdc.math.copysignf copysign; + alias stdc.math.copysignl copysign; + + alias stdc.math.nan nan; + alias stdc.math.nanf nan; + alias stdc.math.nanl nan; + + alias stdc.math.nextafter nextafter; + alias stdc.math.nextafterf nextafter; + alias stdc.math.nextafterl nextafter; + + alias stdc.math.nexttoward nexttoward; + alias stdc.math.nexttowardf nexttoward; + alias stdc.math.nexttowardl nexttoward; + + alias stdc.math.fdim fdim; + alias stdc.math.fdimf fdim; + alias stdc.math.fdiml fdim; + + alias stdc.math.fmax fmax; + alias stdc.math.fmaxf fmax; + alias stdc.math.fmaxl fmax; + + alias stdc.math.fmin fmin; + alias stdc.math.fmin fmin; + alias stdc.math.fminl fmin; + + alias stdc.math.fma fma; + alias stdc.math.fmaf fma; + alias stdc.math.fmal fma; + + alias stdc.complex.carg carg; + alias stdc.complex.cargf carg; + alias stdc.complex.cargl carg; + + alias stdc.complex.cimag cimag; + alias stdc.complex.cimagf cimag; + alias stdc.complex.cimagl cimag; + + alias stdc.complex.conj conj; + alias stdc.complex.conjf conj; + alias stdc.complex.conjl conj; + + alias stdc.complex.cproj cproj; + alias stdc.complex.cprojf cproj; + alias stdc.complex.cprojl cproj; + +// alias stdc.complex.creal creal; +// alias stdc.complex.crealf creal; +// alias stdc.complex.creall creal; +} diff --git a/import/stdc/time.d b/import/stdc/time.d index 6030c58..7422c83 100644 --- a/import/stdc/time.d +++ b/import/stdc/time.d @@ -59,7 +59,7 @@ else version( darwin ) } else version( freebsd ) { - clock_t CLOCKS_PER_SEC = 128; + clock_t CLOCKS_PER_SEC = 128; } else { @@ -93,3 +93,7 @@ else version( linux ) { void tzset(); } +else version( freebsd ) +{ + void tzset(); +} -- 2.43.0