$OpenBSD$

Index: runtime/druntime/src/core/stdc/math.d
--- runtime/druntime/src/core/stdc/math.d.orig
+++ runtime/druntime/src/core/stdc/math.d
@@ -45,6 +45,13 @@ version (FreeBSD)
     ///
     enum int FP_ILOGBNAN      = int.max;
 }
+else version (OpenBSD)
+{
+    ///
+    enum int FP_ILOGB0        = -int.max;
+    ///
+    enum int FP_ILOGBNAN      = int.max;
+}
 else version (DragonFlyBSD)
 {
     ///
@@ -820,6 +827,99 @@ else version( FreeBSD )
     int signbit(real x)         { return __signbit(x); }
   }
 }
+else version (OpenBSD)
+{
+    enum
+    {
+        ///
+        FP_INFINITE  = 0x01,
+        ///
+        FP_NAN       = 0x02,
+        ///
+        FP_NORMAL    = 0x04,
+        ///
+        FP_SUBNORMAL = 0x08,
+        ///
+        FP_ZERO      = 0x10,
+    }
+
+    enum
+    {
+        ///
+        FP_FAST_FMA  = 1,
+        ///
+        FP_FAST_FMAF = 1,
+        ///
+        FP_FAST_FMAL = 1,
+    }
+
+    pure int __fpclassifyd(double);
+    pure int __fpclassifyf(float);
+    pure int __fpclassifyl(real);
+    pure int __isfinitef(float);
+    pure int __isfinite(double);
+    pure int __isfinitel(real);
+    pure int __isinff(float);
+    pure int __isinfl(real);
+    pure int __isnanl(real);
+    pure int __isnormalf(float);
+    pure int __isnormal(double);
+    pure int __isnormall(real);
+    pure int __signbit(double);
+    pure int __signbitf(float);
+    pure int __signbitl(real);
+
+  extern (D)
+  {
+    //int fpclassify(real-floating x);
+      ///
+    pure int fpclassify(float x)     { return __fpclassifyf(x); }
+    ///
+    pure int fpclassify(double x)    { return __fpclassifyd(x); }
+    ///
+    pure int fpclassify(real x)      { return __fpclassifyl(x); }
+
+    //int isfinite(real-floating x);
+    ///
+    pure int isfinite(float x)       { return __isfinitef(x); }
+    ///
+    pure int isfinite(double x)      { return __isfinite(x); }
+    ///
+    pure int isfinite(real x)        { return __isfinitel(x); }
+
+    //int isinf(real-floating x);
+    ///
+    pure int isinf(float x)          { return __isinff(x); }
+    ///
+    pure int isinf(double x)         { return __isinfl(x); }
+    ///
+    pure int isinf(real x)           { return __isinfl(x); }
+
+    //int isnan(real-floating x);
+    ///
+    pure int isnan(float x)          { return __isnanl(x); }
+    ///
+    pure int isnan(double x)         { return __isnanl(x); }
+    ///
+    pure int isnan(real x)           { return __isnanl(x); }
+
+    //int isnormal(real-floating x);
+    ///
+    pure int isnormal(float x)       { return __isnormalf(x); }
+    ///
+    pure int isnormal(double x)      { return __isnormal(x); }
+    ///
+    pure int isnormal(real x)        { return __isnormall(x); }
+
+    //int signbit(real-floating x);
+    ///
+    pure int signbit(float x)        { return __signbitf(x); }
+    ///
+    pure int signbit(double x)       { return __signbit(x); }
+    ///
+    pure int signbit(real x)         { return __signbit(x); }
+  }
+}
 else version( DragonFlyBSD )
 {
     enum
@@ -1920,6 +2020,417 @@ else version( FreeBSD )
     double  fma(double x, double y, double z);
     ///
     float   fmaf(float x, float y, float z);
+}
+else version (OpenBSD)
+{
+    ///
+    real    acosl(real x);
+    ///
+    real    asinl(real x);
+    ///
+    pure real    atanl(real x);
+    ///
+    real    atan2l(real y, real x);
+    ///
+    pure real    cosl(real x);
+    ///
+    pure real    sinl(real x);
+    ///
+    pure real    tanl(real x);
+    ///
+    real    acoshl(real x);
+    ///
+    pure real    asinhl(real x);
+    ///
+    real    atanhl(real x);
+    ///
+    real    coshl(real x);
+    ///
+    real    sinhl(real x);
+    ///
+    pure real    tanhl(real x);
+    ///
+    real    expl(real x);
+    ///
+    real    exp2l(real x);
+    ///
+    real    expm1l(real x);
+    ///
+    pure real    frexpl(real value, int* exp);
+    ///
+    int     ilogbl(real x);
+    ///
+    real    ldexpl(real x, int exp);
+    ///
+    real    logbl(real x);
+    ///
+    real    logb10l(real x);
+    ///
+    real    logb1pl(real x);
+    ///
+    real    logb2l(real x);
+    ///
+    pure real    modfl(real value, real *iptr);
+    ///
+    real    scalbnl(real x, int n);
+    ///
+    real    scalblnl(real x, c_long n);
+    ///
+    pure real    cbrtl(real x);
+    ///
+    pure real    fabsl(real x);
+    ///
+    real    hypotl(real x, real y);
+    ///
+    real    powl(real x, real y);
+    ///
+    real    sqrtl(real x);
+    ///
+    pure real    ceill(real x);
+    ///
+    pure real    floorl(real x);
+    ///
+    pure real    nearbyintl(real x);
+    ///
+    pure real    rintl(real x);
+    ///
+    c_long  lrintl(real x);
+    ///
+    long    llrintl(real x);
+    ///
+    pure real    roundl(real x);
+    ///
+    c_long  lroundl(real x);
+    ///
+    long    llroundl(real x);
+    ///
+    pure real    truncl(real x);
+    ///
+    real    fmodl(real x, real y);
+    ///
+    real    remainderl(real x, real y);
+    ///
+    real    remquol(real x, real y, int* quo);
+    ///
+    pure real    copysignl(real x, real y);
+    ///
+    pure double  nan(char* tagp);
+    ///
+    pure float   nanf(char* tagp);
+    ///
+    pure real    nanl(char* tagp);
+    ///
+    real    nextafterl(real x, real y);
+    ///
+    real    nexttowardl(real x, real y);
+    ///
+    real    fdiml(real x, real y);
+    ///
+    pure real    fmaxl(real x, real y);
+    ///
+    pure real    fminl(real x, real y);
+    ///
+    pure real    fmal(real x, real y, real z);
+
+    ///
+    double  acos(double x);
+    ///
+    float   acosf(float x);
+
+    ///
+    double  asin(double x);
+    ///
+    float   asinf(float x);
+
+    ///
+    pure double  atan(double x);
+    ///
+    pure float   atanf(float x);
+
+    ///
+    double  atan2(double y, double x);
+    ///
+    float   atan2f(float y, float x);
+
+    ///
+    pure double  cos(double x);
+    ///
+    pure float   cosf(float x);
+
+    ///
+    pure double  sin(double x);
+    ///
+    pure float   sinf(float x);
+
+    ///
+    pure double  tan(double x);
+    ///
+    pure float   tanf(float x);
+
+    ///
+    double  acosh(double x);
+    ///
+    float   acoshf(float x);
+
+    ///
+    pure double  asinh(double x);
+    ///
+    pure float   asinhf(float x);
+
+    ///
+    double  atanh(double x);
+    ///
+    float   atanhf(float x);
+
+    ///
+    double  cosh(double x);
+    ///
+    float   coshf(float x);
+
+    ///
+    double  sinh(double x);
+    ///
+    float   sinhf(float x);
+
+    ///
+    pure double  tanh(double x);
+    ///
+    pure float   tanhf(float x);
+
+    ///
+    double  exp(double x);
+    ///
+    float   expf(float x);
+
+    ///
+    double  exp2(double x);
+    ///
+    float   exp2f(float x);
+    ///
+    real    exp2l(real x);
+
+    ///
+    double  expm1(double x);
+    ///
+    float   expm1f(float x);
+
+    ///
+    pure double  frexp(double value, int* exp);
+    ///
+    pure float   frexpf(float value, int* exp);
+
+    ///
+    int     ilogb(double x);
+    ///
+    int     ilogbf(float x);
+
+    ///
+    double  ldexp(double x, int exp);
+    ///
+    float   ldexpf(float x, int exp);
+
+    ///
+    double  log(double x);
+    ///
+    float   logf(float x);
+
+    ///
+    double  log10(double x);
+    ///
+    float   log10f(float x);
+
+    ///
+    double  log1p(double x);
+    ///
+    float   log1pf(float x);
+
+    ///
+    double  log2(double x);
+    ///
+    float   log2f(float x);
+    ///
+    real    log2l(real x);
+
+    ///
+    double  logb(double x);
+    ///
+    float   logbf(float x);
+
+    ///
+    real logl(real x);
+    ///
+    real log10l(real x);
+    ///
+    real log1pl(real x);
+    ///
+    real logbl(real x);
+    ///
+    pure double  modf(double value, double* iptr);
+    ///
+    pure float   modff(float value, float* iptr);
+
+    ///
+    double  scalbn(double x, int n);
+    ///
+    float   scalbnf(float x, int n);
+
+    ///
+    double  scalbln(double x, c_long n);
+    ///
+    float   scalblnf(float x, c_long n);
+
+    ///
+    pure double  cbrt(double x);
+    ///
+    pure float   cbrtf(float x);
+
+    ///
+    pure double  fabs(double x);
+    ///
+    pure float   fabsf(float x);
+
+    ///
+    double  hypot(double x, double y);
+    ///
+    float   hypotf(float x, float y);
+
+    ///
+    double  pow(double x, double y);
+    ///
+    float   powf(float x, float y);
+
+    ///
+    double  sqrt(double x);
+    ///
+    float   sqrtf(float x);
+
+    ///
+    pure double  erf(double x);
+    ///
+    pure float   erff(float x);
+    ///
+    pure real    erfl(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  tgamma(double x);
+    ///
+    float   tgammaf(float x);
+    ///
+    real    tgammal(real x);
+
+    ///
+    pure double  ceil(double x);
+    ///
+    pure float   ceilf(float x);
+
+    ///
+    pure double  floor(double x);
+    ///
+    pure float   floorf(float x);
+
+    ///
+    pure double  nearbyint(double x);
+    ///
+    pure float   nearbyintf(float x);
+
+    ///
+    pure double  rint(double x);
+    ///
+    pure float   rintf(float x);
+
+    ///
+    c_long  lrint(double x);
+    ///
+    c_long  lrintf(float x);
+
+    ///
+    long    llrint(double x);
+    ///
+    long    llrintf(float x);
+
+    ///
+    pure double  round(double x);
+    ///
+    pure float   roundf(float x);
+
+    ///
+    c_long  lround(double x);
+    ///
+    c_long  lroundf(float x);
+
+    ///
+    long    llround(double x);
+    ///
+    long    llroundf(float x);
+
+    ///
+    pure double  trunc(double x);
+    ///
+    pure float   truncf(float x);
+
+    ///
+    double  fmod(double x, double y);
+    ///
+    float   fmodf(float x, float y);
+
+    ///
+    double  remainder(double x, double y);
+    ///
+    float   remainderf(float x, float y);
+
+    ///
+    double  remquo(double x, double y, int* quo);
+    ///
+    float   remquof(float x, float y, int* quo);
+
+    ///
+    pure double  copysign(double x, double y);
+    ///
+    pure float   copysignf(float x, float y);
+
+    ///
+    double  nextafter(double x, double y);
+    ///
+    float   nextafterf(float x, float y);
+
+    ///
+    double  nexttoward(double x, real y);
+    ///
+    float   nexttowardf(float x, real y);
+
+    ///
+    double  fdim(double x, double y);
+    ///
+    float   fdimf(float x, float y);
+
+    ///
+    pure double  fmax(double x, double y);
+    ///
+    pure float   fmaxf(float x, float y);
+
+    ///
+    pure double  fmin(double x, double y);
+    ///
+    pure float   fminf(float x, float y);
+
+    ///
+    pure double  fma(double x, double y, double z);
+    ///
+    pure float   fmaf(float x, float y, float z);
 }
 else version(DragonFlyBSD)
 {
