瀏覽代碼

Reorder includes for Visual Studio 2015, closes #194

C++ headers need to go first, since PHP headers redefine
"inline" which causes trouble with the C++ header files.
Stefan Siegl 9 年之前
父節點
當前提交
98205461be
共有 11 個文件被更改,包括 57 次插入66 次删除
  1. 9 9
      php_v8js_macros.h
  2. 4 5
      v8js_array_access.cc
  3. 9 9
      v8js_class.cc
  4. 2 2
      v8js_commonjs.cc
  5. 8 8
      v8js_convert.cc
  6. 2 4
      v8js_exceptions.cc
  7. 5 6
      v8js_object_export.cc
  8. 7 6
      v8js_timer.cc
  9. 5 6
      v8js_v8.cc
  10. 5 6
      v8js_v8object_class.cc
  11. 1 5
      v8js_variables.cc

+ 9 - 9
php_v8js_macros.h

@@ -18,6 +18,15 @@
 #define _GLIBCXX_USE_NANOSLEEP 1
 #endif
 
+#include <chrono>
+#include <deque>
+#include <thread>
+
+#include <map>
+#include <list>
+#include <vector>
+#include <mutex>
+
 extern "C" {
 #include "php.h"
 #include "php_v8js.h"
@@ -31,15 +40,6 @@ extern "C" {
 
 #include <v8.h>
 
-#include <chrono>
-#include <deque>
-#include <thread>
-
-#include <map>
-#include <list>
-#include <vector>
-#include <mutex>
-
 #include "v8js_class.h"
 #include "v8js_v8.h"
 

+ 4 - 5
v8js_array_access.cc

@@ -14,6 +14,10 @@
 #include "config.h"
 #endif
 
+#include "php_v8js_macros.h"
+#include "v8js_array_access.h"
+#include "v8js_object_export.h"
+
 extern "C" {
 #include "php.h"
 #include "ext/date/php_date.h"
@@ -22,11 +26,6 @@ extern "C" {
 #include "zend_closures.h"
 }
 
-#include "php_v8js_macros.h"
-#include "v8js_array_access.h"
-#include "v8js_object_export.h"
-
-
 static zval v8js_array_access_dispatch(zend_object *object, const char *method_name, int param_count,
 									   uint32_t index, zval zvalue TSRMLS_DC) /* {{{ */
 {

+ 9 - 9
v8js_class.cc

@@ -16,6 +16,15 @@
 #include "config.h"
 #endif
 
+#include <functional>
+#include <algorithm>
+
+#include "php_v8js_macros.h"
+#include "v8js_v8.h"
+#include "v8js_exceptions.h"
+#include "v8js_v8object_class.h"
+#include "v8js_timer.h"
+
 extern "C" {
 #include "php.h"
 #include "ext/date/php_date.h"
@@ -26,15 +35,6 @@ extern "C" {
 #include "zend_exceptions.h"
 }
 
-#include "php_v8js_macros.h"
-#include "v8js_v8.h"
-#include "v8js_exceptions.h"
-#include "v8js_v8object_class.h"
-#include "v8js_timer.h"
-
-#include <functional>
-#include <algorithm>
-
 #define PHP_V8JS_SCRIPT_RES_NAME "V8Js script"
 
 /* {{{ Class Entries */

+ 2 - 2
v8js_commonjs.cc

@@ -15,13 +15,13 @@
 #include "config.h"
 #endif
 
+#include "php_v8js_macros.h"
+
 extern "C" {
 #include "php.h"
 #include "zend_exceptions.h"
 }
 
-#include "php_v8js_macros.h"
-
 static void v8js_commonjs_split_terms(const char *identifier, std::vector<char *> &terms)
 {
     char *term = (char *) emalloc(PATH_MAX), *ptr = term;

+ 8 - 8
v8js_convert.cc

@@ -15,6 +15,14 @@
 #include "config.h"
 #endif
 
+#include <stdexcept>
+#include <limits>
+
+#include "php_v8js_macros.h"
+#include "v8js_object_export.h"
+#include "v8js_v8object_class.h"
+#include "v8js_v8.h"
+
 extern "C" {
 #include "php.h"
 #include "ext/date/php_date.h"
@@ -23,14 +31,6 @@ extern "C" {
 #include "zend_closures.h"
 }
 
-#include "php_v8js_macros.h"
-#include "v8js_object_export.h"
-#include "v8js_v8object_class.h"
-#include "v8js_v8.h"
-
-#include <stdexcept>
-#include <limits>
-
 static int v8js_is_assoc_array(HashTable *myht TSRMLS_DC) /* {{{ */
 {
 	zend_string *key;

+ 2 - 4
v8js_exceptions.cc

@@ -16,8 +16,9 @@
 #include "config.h"
 #endif
 
+#include "php_v8js_macros.h"
+
 extern "C" {
-#include "php.h"
 #include "ext/date/php_date.h"
 #include "ext/standard/php_string.h"
 #include "zend_interfaces.h"
@@ -26,9 +27,6 @@ extern "C" {
 #include "zend_exceptions.h"
 }
 
-#include "php_v8js_macros.h"
-
-
 /* {{{ Class Entries */
 zend_class_entry *php_ce_v8js_exception;
 zend_class_entry *php_ce_v8js_script_exception;

+ 5 - 6
v8js_object_export.cc

@@ -15,8 +15,12 @@
 #include "config.h"
 #endif
 
+#include "php_v8js_macros.h"
+#include "v8js_array_access.h"
+#include "v8js_object_export.h"
+#include "v8js_v8object_class.h"
+
 extern "C" {
-#include "php.h"
 #include "ext/date/php_date.h"
 #include "ext/standard/php_string.h"
 #include "zend_interfaces.h"
@@ -24,11 +28,6 @@ extern "C" {
 #include "zend_exceptions.h"
 }
 
-#include "php_v8js_macros.h"
-#include "v8js_array_access.h"
-#include "v8js_object_export.h"
-#include "v8js_v8object_class.h"
-
 static void v8js_weak_object_callback(const v8::WeakCallbackData<v8::Object, zend_object> &data);
 
 /* Callback for PHP methods and functions */

+ 7 - 6
v8js_timer.cc

@@ -15,8 +15,14 @@
 #include "config.h"
 #endif
 
+#include <concrt.h>
+
+#include "php_v8js_macros.h"
+#include "v8js_v8.h"
+#include "v8js_exceptions.h"
+#include "v8js_timer.h"
+
 extern "C" {
-#include "php.h"
 #include "ext/date/php_date.h"
 #include "ext/standard/php_string.h"
 #include "zend_interfaces.h"
@@ -25,11 +31,6 @@ extern "C" {
 #include "zend_exceptions.h"
 }
 
-#include "php_v8js_macros.h"
-#include "v8js_v8.h"
-#include "v8js_exceptions.h"
-#include "v8js_timer.h"
-
 static void v8js_timer_interrupt_handler(v8::Isolate *isolate, void *data) { /* {{{ */
 	zend_v8js_globals *globals = static_cast<zend_v8js_globals *>(data);
 

+ 5 - 6
v8js_v8.cc

@@ -16,8 +16,12 @@
 #include "config.h"
 #endif
 
+#include "php_v8js_macros.h"
+#include "v8js_v8.h"
+#include "v8js_timer.h"
+#include "v8js_exceptions.h"
+
 extern "C" {
-#include "php.h"
 #include "ext/date/php_date.h"
 #include "ext/standard/php_string.h"
 #include "zend_interfaces.h"
@@ -29,11 +33,6 @@ extern "C" {
 #include <libplatform/libplatform.h>
 #endif
 
-#include "php_v8js_macros.h"
-#include "v8js_v8.h"
-#include "v8js_timer.h"
-#include "v8js_exceptions.h"
-
 void v8js_v8_init(TSRMLS_D) /* {{{ */
 {
 	/* Run only once; thread-local test first */

+ 5 - 6
v8js_v8object_class.cc

@@ -15,8 +15,12 @@
 #include "config.h"
 #endif
 
+#include "php_v8js_macros.h"
+#include "v8js_exceptions.h"
+#include "v8js_v8.h"
+#include "v8js_v8object_class.h"
+
 extern "C" {
-#include "php.h"
 #include "ext/date/php_date.h"
 #include "ext/standard/php_string.h"
 #include "zend_interfaces.h"
@@ -25,11 +29,6 @@ extern "C" {
 #include "zend_exceptions.h"
 }
 
-#include "php_v8js_macros.h"
-#include "v8js_exceptions.h"
-#include "v8js_v8.h"
-#include "v8js_v8object_class.h"
-
 /* {{{ Class Entries */
 zend_class_entry *php_ce_v8object;
 zend_class_entry *php_ce_v8function;

+ 1 - 5
v8js_variables.cc

@@ -17,13 +17,9 @@
 #include "config.h"
 #endif
 
-extern "C" {
-#include "php.h"
-}
+#include <string>
 
 #include "php_v8js_macros.h"
-#include <v8.h>
-#include <string>
 
 static void v8js_fetch_php_variable(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) /* {{{ */
 {