Bernard Xiong 8 лет назад
Родитель
Сommit
b618e994b3
2 измененных файлов с 11 добавлено и 0 удалено
  1. 9 0
      rtthread-port/jerry_module.h
  2. 2 0
      rtthread-port/jerry_util.h

+ 9 - 0
rtthread-port/jerry_module.h

@@ -1,10 +1,19 @@
 #ifndef JERRY_MODULE_H__
 #define JERRY_MODULE_H__
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 char *js_module_dirname(char *path);
 char *js_module_normalize_path(const char *directory, const char *filename);
 
 int   js_module_init(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 

+ 2 - 0
rtthread-port/jerry_util.h

@@ -23,6 +23,8 @@
 #include <finsh.h>
 #define JS_MODULE(NAME, MODULE_INIT)    \
     FINSH_FUNCTION_EXPORT_CMD(MODULE_INIT, __jsm_ ##NAME, RT_NULL)
+#else
+#define JS_MODULE(NAME, MODULE_INIT)
 #endif
 
 #ifdef __cplusplus