浏览代码

minor fixes

Vladislav Gritsenko 7 年之前
父节点
当前提交
e3ebc1b702
共有 2 个文件被更改,包括 12 次插入5 次删除
  1. 5 3
      include/enet.h
  2. 7 2
      misc/build-singleheader.js

+ 5 - 3
include/enet.h

@@ -1,5 +1,5 @@
 /**
- * includes/enet.h - a Single-Header auto-generated variant of enet.h library.
+ * include/enet.h - a Single-Header auto-generated variant of enet.h library.
  *
  * Usage:
  * #define ENET_IMPLEMENTATION exactly in ONE source file right BEFORE including the library, like:
@@ -9,6 +9,10 @@
  *
  */
 
+#ifdef ENET_IMPLEMENTATION
+#define ENET_BUILDING_LIB 1
+#endif
+
 /**
  @file  enet.h
  @brief ENet public header file
@@ -1021,8 +1025,6 @@ extern size_t enet_protocol_command_size (enet_uint8);
 #if defined(ENET_IMPLEMENTATION) && !defined(ENET_IMPLEMENTATION_DONE)
 #define ENET_IMPLEMENTATION_DONE
 
-    #define ENET_BUILDING_LIB 1
-
     #ifdef __cplusplus
     extern "C"
     {

+ 7 - 2
misc/build-singleheader.js

@@ -80,8 +80,6 @@ let scr_template = [
 #if defined(ENET_IMPLEMENTATION) && !defined(ENET_IMPLEMENTATION_DONE)
 #define ENET_IMPLEMENTATION_DONE
 
-    #define ENET_BUILDING_LIB 1
-
     #ifdef __cplusplus
     extern "C"
     {
@@ -110,6 +108,10 @@ let prefix =
  *
  */
 
+#ifdef ENET_IMPLEMENTATION
+#define ENET_BUILDING_LIB 1
+#endif
+
 `;
 
 (function main() {
@@ -120,5 +122,8 @@ let prefix =
     src = filter_libs(src, list)
     src = attach_src(src, list, sources, scr_template)
 
+    console.log(list)
+    // console.log('all included libs:\n', Object.keys(list).sort())
+
     fs.writeFileSync('include/enet.h', prefix + src)
 })();