Browse Source

Add CreateParams fields in v8js_ctx only if needed

Stefan Siegl 9 years ago
parent
commit
93d3f9591f
1 changed files with 7 additions and 1 deletions
  1. 7 1
      v8js_class.h

+ 7 - 1
v8js_class.h

@@ -2,12 +2,13 @@
   +----------------------------------------------------------------------+
   | 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      |
   +----------------------------------------------------------------------+
   | Author: Jani Taskinen <[email protected]>                         |
   | Author: Patrick Reilly <[email protected]>                             |
+  | Author: Stefan Siegl <[email protected]>                                |
   +----------------------------------------------------------------------+
 */
 
@@ -68,8 +69,13 @@ struct v8js_ctx {
   std::vector<struct _v8js_script *> script_objects;
   char *tz;
 
+#if PHP_V8_API_VERSION >= 4004044
   v8::Isolate::CreateParams create_params;
+#ifdef PHP_V8_USE_EXTERNAL_STARTUP_DATA
   v8::StartupData snapshot_blob;
+#endif
+#endif
+
 #ifdef ZTS
   void ***zts_ctx;
 #endif