mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 15:11:53 +00:00
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
This commit is contained in:
parent
317f01f588
commit
c2a2cc341f
10
config.w32
10
config.w32
@ -2,7 +2,11 @@
|
|||||||
ARG_WITH("v8js", "for V8 Javascript Engine", "no");
|
ARG_WITH("v8js", "for V8 Javascript Engine", "no");
|
||||||
|
|
||||||
if (PHP_V8JS != "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")) {
|
CHECK_HEADER_ADD_INCLUDE("v8.h", "CFLAGS_V8JS")) {
|
||||||
|
|
||||||
ADD_FLAG("CFLAGS_V8JS", "/EHcs");
|
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 ZEND_WIN32_FORCE_INLINE");
|
||||||
ADD_FLAG("CFLAGS_V8JS", "/D __STDC_LIMIT_MACROS");
|
ADD_FLAG("CFLAGS_V8JS", "/D __STDC_LIMIT_MACROS");
|
||||||
|
|
||||||
AC_DEFINE("PHP_V8_API_VERSION", "3017015", "", false);
|
AC_DEFINE("PHP_V8_API_VERSION", "4007075", "", false);
|
||||||
AC_DEFINE("PHP_V8_VERSION", "3.17.15", "", true);
|
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");
|
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");
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ struct _v8js_process_globals {
|
|||||||
/* V8 command line flags */
|
/* V8 command line flags */
|
||||||
char *v8_flags;
|
char *v8_flags;
|
||||||
|
|
||||||
#if !defined(_WIN32) && PHP_V8_API_VERSION >= 3029036
|
#if PHP_V8_API_VERSION >= 3029036
|
||||||
v8::Platform *v8_platform;
|
v8::Platform *v8_platform;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -27,6 +27,6 @@ Fatal error: Uncaught Error: Call to a member function bar() on %s in %s%efatal_
|
|||||||
Stack trace:
|
Stack trace:
|
||||||
#0 [internal function]: {closure}()
|
#0 [internal function]: {closure}()
|
||||||
#1 [internal function]: Closure->__invoke()
|
#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}
|
#3 {main}
|
||||||
thrown in %s%efatal_error_rethrow.php on line 7
|
thrown in %s%efatal_error_rethrow.php on line 7
|
||||||
|
@ -70,7 +70,7 @@ object(V8JsScriptException)#%d (13) {
|
|||||||
["args"]=>
|
["args"]=>
|
||||||
array(2) {
|
array(2) {
|
||||||
[0]=>
|
[0]=>
|
||||||
string(109) "
|
string(%d) "
|
||||||
PHP.greeter.sayHello();
|
PHP.greeter.sayHello();
|
||||||
|
|
||||||
var ngGreeter = new PHP.greeter.constructor("Ringo");
|
var ngGreeter = new PHP.greeter.constructor("Ringo");
|
||||||
|
2
v8js.cc
2
v8js.cc
@ -153,7 +153,7 @@ static PHP_MSHUTDOWN_FUNCTION(v8js)
|
|||||||
|
|
||||||
if(v8_initialized) {
|
if(v8_initialized) {
|
||||||
v8::V8::Dispose();
|
v8::V8::Dispose();
|
||||||
#if !defined(_WIN32) && PHP_V8_API_VERSION >= 3029036
|
#if PHP_V8_API_VERSION >= 3029036
|
||||||
v8::V8::ShutdownPlatform();
|
v8::V8::ShutdownPlatform();
|
||||||
// @fixme call virtual destructor somehow
|
// @fixme call virtual destructor somehow
|
||||||
//delete v8js_process_globals.v8_platform;
|
//delete v8js_process_globals.v8_platform;
|
||||||
|
@ -29,7 +29,7 @@ extern "C" {
|
|||||||
#include "zend_exceptions.h"
|
#include "zend_exceptions.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(_WIN32) && PHP_V8_API_VERSION >= 3029036
|
#if PHP_V8_API_VERSION >= 3029036
|
||||||
#include <libplatform/libplatform.h>
|
#include <libplatform/libplatform.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ void v8js_v8_init(TSRMLS_D) /* {{{ */
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(_WIN32) && PHP_V8_API_VERSION >= 3029036
|
#if PHP_V8_API_VERSION >= 3029036
|
||||||
v8js_process_globals.v8_platform = v8::platform::CreateDefaultPlatform();
|
v8js_process_globals.v8_platform = v8::platform::CreateDefaultPlatform();
|
||||||
v8::V8::InitializePlatform(v8js_process_globals.v8_platform);
|
v8::V8::InitializePlatform(v8js_process_globals.v8_platform);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user