瀏覽代碼

provide isnan macro, if missing, closes #227

Stefan Siegl 9 年之前
父節點
當前提交
de8d9b30c0
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      php_v8js_macros.h

+ 8 - 1
php_v8js_macros.h

@@ -2,12 +2,13 @@
   +----------------------------------------------------------------------+
   +----------------------------------------------------------------------+
   | PHP Version 5                                                        |
   | PHP Version 5                                                        |
   +----------------------------------------------------------------------+
   +----------------------------------------------------------------------+
-  | Copyright (c) 1997-2013 The PHP Group                                |
+  | Copyright (c) 1997-2016 The PHP Group                                |
   +----------------------------------------------------------------------+
   +----------------------------------------------------------------------+
   | http://www.opensource.org/licenses/mit-license.php  MIT License      |
   | http://www.opensource.org/licenses/mit-license.php  MIT License      |
   +----------------------------------------------------------------------+
   +----------------------------------------------------------------------+
   | Author: Jani Taskinen <[email protected]>                         |
   | Author: Jani Taskinen <[email protected]>                         |
   | Author: Patrick Reilly <[email protected]>                             |
   | Author: Patrick Reilly <[email protected]>                             |
+  | Author: Stefan Siegl <[email protected]>                                |
   +----------------------------------------------------------------------+
   +----------------------------------------------------------------------+
 */
 */
 
 
@@ -27,6 +28,12 @@
 #include <vector>
 #include <vector>
 #include <mutex>
 #include <mutex>
 
 
+#ifndef isnan
+/* php.h requires the isnan() macro, which is removed by c++ <cmath> header,
+ * work around: re-define the macro to std::isnan function */
+#define isnan(a) std::isnan(a)
+#endif
+
 extern "C" {
 extern "C" {
 #include "php.h"
 #include "php.h"
 #include "php_v8js.h"
 #include "php_v8js.h"