瀏覽代碼

dtoolbase: Fix ability to use std::round() compiling for macOS 10.6

rdb 4 年之前
父節點
當前提交
2a5b5030ba
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      dtool/src/dtoolbase/dtoolbase_cc.h

+ 12 - 0
dtool/src/dtoolbase/dtoolbase_cc.h

@@ -162,6 +162,18 @@ namespace std {
       __atomic_clear(&_flag, order);
     }
   };
+
+  ALWAYS_INLINE float round(float arg) {
+    return ::roundf(arg);
+  }
+  ALWAYS_INLINE double round(double arg) {
+    return ::round(arg);
+  }
+  ALWAYS_INLINE long double round(long double arg) {
+    return ::roundl(arg);
+  }
+  using ::roundf;
+  using ::roundl;
 };
 #else
 // Expect that we have access to the <atomic> header.