Pārlūkot izejas kodu

Initialize libv8_platform for Windows as well

V8 doesn't work without libplatform anymore, even under
Windows.

Furthermore adapted two tests to \r\n vs. \n line
ending differences
Stefan Siegl 10 gadi atpakaļ
vecāks
revīzija
c2a2cc341f
6 mainītis faili ar 13 papildinājumiem un 9 dzēšanām
  1. 7 3
      config.w32
  2. 1 1
      php_v8js_macros.h
  3. 1 1
      tests/fatal_error_rethrow.phpt
  4. 1 1
      tests/js-construct-protected-ctor.phpt
  5. 1 1
      v8js.cc
  6. 2 2
      v8js_v8.cc

+ 7 - 3
config.w32

@@ -2,7 +2,11 @@
 ARG_WITH("v8js", "for V8 Javascript Engine", "no");
 
 if (PHP_V8JS != "no") {
-	if (CHECK_LIB("v8.lib", "v8js") &&
+	if (CHECK_LIB("v8_libplatform.lib", "v8js") &&
+			CHECK_LIB("v8_libbase.lib", "v8js") &&
+			CHECK_LIB("winmm.lib", "v8js") &&
+
+			CHECK_LIB("v8.lib", "v8js") &&
 			CHECK_HEADER_ADD_INCLUDE("v8.h", "CFLAGS_V8JS")) {
 
 		ADD_FLAG("CFLAGS_V8JS", "/EHcs");
@@ -10,8 +14,8 @@ if (PHP_V8JS != "no") {
 		ADD_FLAG("CFLAGS_V8JS", "/D ZEND_WIN32_FORCE_INLINE");
 		ADD_FLAG("CFLAGS_V8JS", "/D __STDC_LIMIT_MACROS");
 
-		AC_DEFINE("PHP_V8_API_VERSION", "3017015", "", false);
-		AC_DEFINE("PHP_V8_VERSION", "3.17.15", "", true);
+		AC_DEFINE("PHP_V8_API_VERSION", "4007075", "", false);
+		AC_DEFINE("PHP_V8_VERSION", "4.7.75", "", true);
 
 		EXTENSION("v8js", "v8js_array_access.cc v8js.cc v8js_class.cc v8js_commonjs.cc v8js_convert.cc v8js_exceptions.cc v8js_methods.cc v8js_object_export.cc v8js_timer.cc v8js_v8.cc v8js_v8object_class.cc v8js_variables.cc", "yes");
 

+ 1 - 1
php_v8js_macros.h

@@ -146,7 +146,7 @@ struct _v8js_process_globals {
 	/* V8 command line flags */
 	char *v8_flags;
 
-#if !defined(_WIN32) && PHP_V8_API_VERSION >= 3029036
+#if PHP_V8_API_VERSION >= 3029036
 	v8::Platform *v8_platform;
 #endif
 };

+ 1 - 1
tests/fatal_error_rethrow.phpt

@@ -27,6 +27,6 @@ Fatal error: Uncaught Error: Call to a member function bar() on %s in %s%efatal_
 Stack trace:
 #0 [internal function]: {closure}()
 #1 [internal function]: Closure->__invoke()
-#2 %s%efatal_error_rethrow.php(16): V8Js->executeString('\nPHP.foo();\n')
+#2 %s%efatal_error_rethrow.php(16): V8Js->executeString(%s)
 #3 {main}
   thrown in %s%efatal_error_rethrow.php on line 7

+ 1 - 1
tests/js-construct-protected-ctor.phpt

@@ -70,7 +70,7 @@ object(V8JsScriptException)#%d (13) {
       ["args"]=>
       array(2) {
         [0]=>
-        string(109) "
+        string(%d) "
 		PHP.greeter.sayHello();
 
 		var ngGreeter = new PHP.greeter.constructor("Ringo");

+ 1 - 1
v8js.cc

@@ -153,7 +153,7 @@ static PHP_MSHUTDOWN_FUNCTION(v8js)
 
 	if(v8_initialized) {
 		v8::V8::Dispose();
-#if !defined(_WIN32) && PHP_V8_API_VERSION >= 3029036
+#if PHP_V8_API_VERSION >= 3029036
 		v8::V8::ShutdownPlatform();
 		// @fixme call virtual destructor somehow
 		//delete v8js_process_globals.v8_platform;

+ 2 - 2
v8js_v8.cc

@@ -29,7 +29,7 @@ extern "C" {
 #include "zend_exceptions.h"
 }
 
-#if !defined(_WIN32) && PHP_V8_API_VERSION >= 3029036
+#if PHP_V8_API_VERSION >= 3029036
 #include <libplatform/libplatform.h>
 #endif
 
@@ -53,7 +53,7 @@ void v8js_v8_init(TSRMLS_D) /* {{{ */
 	}
 #endif
 
-#if !defined(_WIN32) && PHP_V8_API_VERSION >= 3029036
+#if PHP_V8_API_VERSION >= 3029036
 	v8js_process_globals.v8_platform = v8::platform::CreateDefaultPlatform();
 	v8::V8::InitializePlatform(v8js_process_globals.v8_platform);
 #endif