瀏覽代碼

Add ios differentiation, and .clangd that works w/Zed and clangd.

Adam Ierymenko 10 月之前
父節點
當前提交
8d474e1395
共有 2 個文件被更改,包括 12 次插入6 次删除
  1. 5 1
      .clangd
  2. 7 5
      node/Constants.hpp

+ 5 - 1
.clangd

@@ -1,2 +1,6 @@
 CompileFlags:
 CompileFlags:
-  Add: [-std=c++17]
+  Add:
+    - "-std=c++17"
+    - "-I../ext"
+    - "-I../ext/prometheus-cpp-lite-1.0/core/include"
+    - "-I../ext/prometheus-cpp-lite-1.0/simpleapi/include"

+ 7 - 5
node/Constants.hpp

@@ -223,11 +223,13 @@
 #define ZT_PLATFORM_NAME "aix" // IBM AIX
 #define ZT_PLATFORM_NAME "aix" // IBM AIX
 #elif defined(__APPLE__) && defined(__MACH__) // Apple OSX and iOS (Darwin)
 #elif defined(__APPLE__) && defined(__MACH__) // Apple OSX and iOS (Darwin)
 #include <TargetConditionals.h>
 #include <TargetConditionals.h>
-#if TARGET_IPHONE_SIMULATOR == 1
-#define ZT_PLATFORM_NAME "ios" // Apple iOS
-#elif TARGET_OS_IPHONE == 1
-#define ZT_PLATFORM_NAME "ios" // Apple iOS
-#elif TARGET_OS_MAC == 1
+#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR == 1
+#define ZT_PLATFORM_NAME "ios_sim" // Apple iOS
+#elif defined(TARGET_OS_IPAD) && TARGET_OS_IPAD == 1
+#define ZT_PLATFORM_NAME "ios_ipad"
+#elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1
+#define ZT_PLATFORM_NAME "ios_iphone" // Apple iOS
+#elif defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1
 #define ZT_PLATFORM_NAME "macos" // Apple OSX
 #define ZT_PLATFORM_NAME "macos" // Apple OSX
 #endif
 #endif
 #elif defined(__sun) && defined(__SVR4)
 #elif defined(__sun) && defined(__SVR4)