瀏覽代碼

Move v8js_commonjs.cc forward declarations in .h file

Stefan Siegl 9 年之前
父節點
當前提交
754d398ec9
共有 3 個文件被更改,包括 20 次插入4 次删除
  1. 1 1
      v8js_commonjs.cc
  2. 18 0
      v8js_commonjs.h
  3. 1 3
      v8js_methods.cc

+ 1 - 1
v8js_commonjs.cc

@@ -22,7 +22,7 @@ extern "C" {
 
 #include "php_v8js_macros.h"
 
-void v8js_commonjs_split_terms(char *identifier, std::vector<char *> &terms)
+static void v8js_commonjs_split_terms(char *identifier, std::vector<char *> &terms)
 {
     char *term = (char *)malloc(PATH_MAX), *ptr = term;
 

+ 18 - 0
v8js_commonjs.h

@@ -0,0 +1,18 @@
+/*
+  +----------------------------------------------------------------------+
+  | PHP Version 5                                                        |
+  +----------------------------------------------------------------------+
+  | Copyright (c) 1997-2015 The PHP Group                                |
+  +----------------------------------------------------------------------+
+  | http://www.opensource.org/licenses/mit-license.php  MIT License      |
+  +----------------------------------------------------------------------+
+  | Author: Stefan Siegl <[email protected]>                          |
+  +----------------------------------------------------------------------+
+*/
+
+#ifndef V8JS_COMMONJS_H
+#define V8JS_COMMONJS_H
+
+void v8js_commonjs_normalise_identifier(char *base, char *identifier, char *normalised_path, char *module_name);
+
+#endif /* V8JS_COMMONJS_H */

+ 1 - 3
v8js_methods.cc

@@ -16,14 +16,12 @@
 #endif
 
 #include "php_v8js_macros.h"
+#include "v8js_commonjs.h"
 
 extern "C" {
 #include "zend_exceptions.h"
 }
 
-/* Forward declarations */
-void v8js_commonjs_normalise_identifier(char *base, char *identifier, char *normalised_path, char *module_name);
-
 /* global.exit - terminate execution */
 V8JS_METHOD(exit) /* {{{ */
 {