From 1bb0c717d07a445f68e8df75a95d4571d57917ba Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 20 Jan 2020 15:12:49 +0800 Subject: [PATCH] fix macro redefine warning of platform defination (#2099) --- .../cocos2d_libs.xcodeproj/project.pbxproj | 18 -- native/cocos/audio/AudioEngine.cpp | 14 +- .../cocos/audio/android/AudioEngine-inl.cpp | 2 +- native/cocos/audio/android/AudioEngine-inl.h | 2 +- native/cocos/audio/apple/AudioCache.h | 2 +- native/cocos/audio/apple/AudioCache.mm | 2 +- native/cocos/audio/apple/AudioEngine-inl.h | 2 +- native/cocos/audio/apple/AudioEngine-inl.mm | 8 +- native/cocos/audio/apple/AudioPlayer.h | 2 +- native/cocos/audio/apple/AudioPlayer.mm | 2 +- native/cocos/audio/win32/AudioCache.cpp | 2 +- native/cocos/audio/win32/AudioCache.h | 2 +- .../cocos/audio/win32/AudioEngine-win32.cpp | 2 +- native/cocos/audio/win32/AudioEngine-win32.h | 2 +- native/cocos/audio/win32/AudioPlayer.cpp | 2 +- native/cocos/audio/win32/AudioPlayer.h | 4 +- native/cocos/base/CCConfiguration.cpp | 8 +- native/cocos/base/CCLog.cpp | 8 +- native/cocos/base/CCRenderTexture.cpp | 2 +- native/cocos/base/ZipUtils.h | 4 +- native/cocos/base/base64.cpp | 4 +- native/cocos/base/ccConfig.h | 8 +- native/cocos/base/ccMacros.h | 90 +------- native/cocos/base/ccUTF8.cpp | 2 +- native/cocos/base/ccUTF8.h | 4 +- native/cocos/base/ccUtils.cpp | 2 +- native/cocos/base/ccUtils.h | 2 +- native/cocos/cocos2d.h | 12 +- native/cocos/math/MathUtil.cpp | 8 +- native/cocos/network/CCDownloader.cpp | 4 +- .../cocos/network/HttpAsynConnection-apple.h | 4 +- .../cocos/network/HttpAsynConnection-apple.m | 4 +- native/cocos/network/HttpClient-android.cpp | 4 +- native/cocos/network/HttpClient.cpp | 2 +- native/cocos/network/HttpRequest.h | 2 +- .../cocos/network/WebSocket-libwebsockets.cpp | 6 +- native/cocos/platform/CCFileUtils.cpp | 14 +- native/cocos/platform/CCGL.h | 12 +- native/cocos/platform/CCImage.cpp | 16 +- native/cocos/platform/CCPlatformConfig.h | 147 +++----------- native/cocos/platform/CCPlatformDefine.h | 12 +- native/cocos/platform/CCStdC.h | 4 +- .../platform/android/CCDevice-android.cpp | 4 +- .../platform/android/CCFileUtils-android.cpp | 4 +- .../platform/android/CCFileUtils-android.h | 4 +- native/cocos/platform/android/CCGL-android.h | 4 +- .../android/CCPlatformDefine-android.h | 4 +- .../apple/CCCanvasRenderingContext2D-apple.mm | 26 +-- .../platform/desktop/CCGLView-desktop.cpp | 8 +- .../cocos/platform/desktop/CCGLView-desktop.h | 8 +- native/cocos/platform/ios/CCGL-ios.h | 4 +- native/cocos/platform/ios/CCImage-ios.mm | 4 +- .../cocos/platform/ios/CCPlatformDefine-ios.h | 4 +- native/cocos/platform/ios/CCReachability.cpp | 4 +- .../cocos/platform/ios/OpenGL_Internal-ios.h | 4 +- native/cocos/platform/mac/CCDevice-mac.mm | 4 +- native/cocos/platform/mac/CCGL-mac.h | 4 +- .../cocos/platform/mac/CCPlatformDefine-mac.h | 4 +- .../cocos/platform/win32/CCDevice-win32.cpp | 4 +- .../platform/win32/CCFileUtils-win32.cpp | 4 +- .../cocos/platform/win32/CCFileUtils-win32.h | 4 +- native/cocos/platform/win32/CCGL-win32.h | 4 +- .../platform/win32/CCPlatformDefine-win32.h | 4 +- native/cocos/platform/win32/CCStdC-win32.cpp | 4 +- native/cocos/platform/win32/compat/stdint.h | 4 +- native/cocos/renderer/Macro.h | 192 ------------------ native/cocos/renderer/core/CoreDef.h | 40 +--- native/cocos/renderer/gfx-metal/MTLTexture.mm | 2 +- native/cocos/renderer/soa-mgr/core/CoreDef.h | 10 +- .../auto/jsb_cocos2dx_audioengine_auto.cpp | 4 +- .../auto/jsb_cocos2dx_audioengine_auto.hpp | 4 +- .../auto/jsb_cocos2dx_network_auto.cpp | 4 +- .../auto/jsb_cocos2dx_network_auto.hpp | 4 +- .../js-bindings/auto/jsb_gfx_auto.cpp | 4 +- .../js-bindings/auto/jsb_gfx_auto.hpp | 4 +- .../js-bindings/auto/jsb_video_auto.cpp | 4 +- .../js-bindings/auto/jsb_video_auto.hpp | 4 +- .../js-bindings/auto/jsb_webview_auto.cpp | 4 +- .../js-bindings/auto/jsb_webview_auto.hpp | 4 +- .../js-bindings/jswrapper/v8/ScriptEngine.cpp | 2 +- .../manual/jsb_cocos2dx_network_manual.cpp | 4 +- .../js-bindings/manual/jsb_global.cpp | 20 +- .../manual/jsb_module_register.cpp | 16 +- .../js-bindings/manual/jsb_platfrom_apple.mm | 2 +- .../js-bindings/manual/jsb_websocket.cpp | 4 +- .../js-bindings/manual/jsb_xmlhttprequest.cpp | 4 +- .../local-storage/LocalStorage-android.cpp | 4 +- .../storage/local-storage/LocalStorage.cpp | 6 +- .../ui/videoplayer/VideoPlayer-android.cpp | 2 +- .../cocos/ui/videoplayer/VideoPlayer-ios.mm | 2 +- native/cocos/ui/webview/WebView-inl.h | 4 +- native/cocos/ui/webview/WebViewImpl-ios.mm | 4 +- .../runtime-src/Classes/AppDelegate.cpp | 8 +- .../Classes/ide-support/RuntimeJsImpl.cpp | 4 +- .../lib/network/CCHTTPRequest.cpp | 4 +- .../libsimulator/lib/runtime/ConfigParser.cpp | 4 +- .../lib/runtime/ConnectWaitLayer.cpp | 2 +- .../lib/runtime/ConsoleCommand.cpp | 12 +- .../libsimulator/lib/runtime/FileServer.cpp | 10 +- .../libsimulator/lib/runtime/Runtime.cpp | 20 +- native/tools/tojs/cocos2dx_audioengine.ini | 2 +- native/tools/tojs/cocos2dx_network.ini | 2 +- native/tools/tojs/cocos2dx_video.ini | 2 +- native/tools/tojs/cocos2dx_webview.ini | 2 +- native/tools/tojs/gfx.ini | 2 +- 105 files changed, 294 insertions(+), 713 deletions(-) delete mode 100644 native/cocos/renderer/Macro.h diff --git a/native/build/cocos2d_libs.xcodeproj/project.pbxproj b/native/build/cocos2d_libs.xcodeproj/project.pbxproj index c39acd085b..bcafa5175e 100644 --- a/native/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/native/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -472,10 +472,6 @@ 46BFE03823CD59ED00CC5F8E /* CCConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46BFE03523CD59ED00CC5F8E /* CCConfiguration.cpp */; }; 46BFE03923CD59ED00CC5F8E /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 46BFE03623CD59ED00CC5F8E /* CCConfiguration.h */; }; 46BFE03A23CD59ED00CC5F8E /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 46BFE03623CD59ED00CC5F8E /* CCConfiguration.h */; }; - 46BFE05423D3F4E900CC5F8E /* jsb_gfx_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 46BFE05223D3F4E900CC5F8E /* jsb_gfx_auto.hpp */; }; - 46BFE05523D3F4E900CC5F8E /* jsb_gfx_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 46BFE05223D3F4E900CC5F8E /* jsb_gfx_auto.hpp */; }; - 46BFE05623D3F4E900CC5F8E /* jsb_gfx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46BFE05323D3F4E900CC5F8E /* jsb_gfx_auto.cpp */; }; - 46BFE05723D3F4E900CC5F8E /* jsb_gfx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46BFE05323D3F4E900CC5F8E /* jsb_gfx_auto.cpp */; }; 46FDDB4D202ADDCE00931238 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDAEB202ADDCE00931238 /* pvr.h */; }; 46FDDB4E202ADDCE00931238 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDAEB202ADDCE00931238 /* pvr.h */; }; 46FDDB4F202ADDCE00931238 /* CCValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDAEC202ADDCE00931238 /* CCValue.h */; }; @@ -951,10 +947,8 @@ BAC32B76236C28F200F3D55F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAC32B75236C28F200F3D55F /* UIKit.framework */; }; BAC32B78236C291000F3D55F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAC32B77236C291000F3D55F /* OpenGLES.framework */; }; BAC32B7A236C2B9D00F3D55F /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BAC32B79236C2B9D00F3D55F /* CoreFoundation.framework */; }; - BAC32B8B236C36D300F3D55F /* Macro.h in Headers */ = {isa = PBXBuildFile; fileRef = BAC32B89236C36D300F3D55F /* Macro.h */; }; BAD9FAB323AC9C1900F1B1F1 /* libv8_monolith.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BAD9FAB223AC9C1900F1B1F1 /* libv8_monolith.a */; }; BAD9FAB423ACA39B00F1B1F1 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A62C23583DBD007740C5 /* Core.h */; }; - BAD9FAB523ACA39D00F1B1F1 /* Macro.h in Headers */ = {isa = PBXBuildFile; fileRef = BAC32B89236C36D300F3D55F /* Macro.h */; }; BAEA45551E279D5C00FA219F /* tinydir.h in Headers */ = {isa = PBXBuildFile; fileRef = BAEA45541E279D5C00FA219F /* tinydir.h */; }; BAEA45561E279D5C00FA219F /* tinydir.h in Headers */ = {isa = PBXBuildFile; fileRef = BAEA45541E279D5C00FA219F /* tinydir.h */; }; BAEC732E23965C7B008A0F30 /* libv8_monolith.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 468A968422F43F8F005034BE /* libv8_monolith.a */; }; @@ -1268,8 +1262,6 @@ 46BFDFF223CC573500CC5F8E /* MTLRenderPass.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTLRenderPass.mm; sourceTree = ""; }; 46BFE03523CD59ED00CC5F8E /* CCConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCConfiguration.cpp; sourceTree = ""; }; 46BFE03623CD59ED00CC5F8E /* CCConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCConfiguration.h; sourceTree = ""; }; - 46BFE05223D3F4E900CC5F8E /* jsb_gfx_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_gfx_auto.hpp; sourceTree = ""; }; - 46BFE05323D3F4E900CC5F8E /* jsb_gfx_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_gfx_auto.cpp; sourceTree = ""; }; 46FDDAEB202ADDCE00931238 /* pvr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pvr.h; sourceTree = ""; }; 46FDDAEC202ADDCE00931238 /* CCValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCValue.h; sourceTree = ""; }; 46FDDAEE202ADDCE00931238 /* utlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utlist.h; sourceTree = ""; }; @@ -1583,7 +1575,6 @@ BAC32B75236C28F200F3D55F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; BAC32B77236C291000F3D55F /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; }; BAC32B79236C2B9D00F3D55F /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; - BAC32B89236C36D300F3D55F /* Macro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Macro.h; sourceTree = ""; }; BAD9FAB223AC9C1900F1B1F1 /* libv8_monolith.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_monolith.a; path = ../external/mac/libs/libv8_monolith.a; sourceTree = ""; }; BAEA45521E279D5C00FA219F /* COPYING */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = COPYING; sourceTree = ""; }; BAEA45531E279D5C00FA219F /* package.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = package.json; sourceTree = ""; }; @@ -2042,8 +2033,6 @@ 469302512046AE05004A3D6C /* auto */ = { isa = PBXGroup; children = ( - 46BFE05323D3F4E900CC5F8E /* jsb_gfx_auto.cpp */, - 46BFE05223D3F4E900CC5F8E /* jsb_gfx_auto.hpp */, 1AAAC871205CB647005321B9 /* jsb_cocos2dx_audioengine_auto.cpp */, 1AAAC872205CB647005321B9 /* jsb_cocos2dx_audioengine_auto.hpp */, 1A29D767205665BE00168D9A /* jsb_cocos2dx_auto.cpp */, @@ -2168,7 +2157,6 @@ 46FDDA2C202ACC6A00931238 /* renderer */ = { isa = PBXGroup; children = ( - BAC32B89236C36D300F3D55F /* Macro.h */, BA06A62B23583DBD007740C5 /* core */, BA06A6F823583DFD007740C5 /* gfx-gles2 */, BA06A73123583DFD007740C5 /* gfx-gles3 */, @@ -3054,9 +3042,7 @@ BA06A85C23584B93007740C5 /* vulkan.h in Headers */, 46BFE01423CC573500CC5F8E /* MTLQueue.h in Headers */, 46AE3FED2092F3A600F3A228 /* http_parser.h in Headers */, - BAD9FAB523ACA39D00F1B1F1 /* Macro.h in Headers */, BA06A6F223583DBD007740C5 /* Object.h in Headers */, - 46BFE05423D3F4E900CC5F8E /* jsb_gfx_auto.hpp in Headers */, 4617864B20522469008256E1 /* HttpCookie.h in Headers */, 1A586C432064C90500B47573 /* EJConvertTypedArray.h in Headers */, ); @@ -3135,10 +3121,8 @@ 50ABBD5B1925AB0000A911A9 /* Vec2.h in Headers */, BA06A76A23583DFE007740C5 /* GLES2PipelineLayout.h in Headers */, BA06A68723583DBD007740C5 /* Memory.h in Headers */, - 46BFE05523D3F4E900CC5F8E /* jsb_gfx_auto.hpp in Headers */, 4008729720CE20C2002EB77B /* jsb_cocos2dx_network_manual.h in Headers */, 50ABBD411925AB0000A911A9 /* CCMath.h in Headers */, - BAC32B8B236C36D300F3D55F /* Macro.h in Headers */, 461786682052607E008256E1 /* jsb_websocket.hpp in Headers */, BAC32B68236C28C600F3D55F /* tommyhashtbl.h in Headers */, 4617865E2052607E008256E1 /* jsb_xmlhttprequest.hpp in Headers */, @@ -3444,7 +3428,6 @@ 1A586C452064C90500B47573 /* EJConvertTypedArray.m in Sources */, 1A29D77B2056667800168D9A /* csscolorparser.cpp in Sources */, BAC32B43236C28C600F3D55F /* tommy.c in Sources */, - 46BFE05623D3F4E900CC5F8E /* jsb_gfx_auto.cpp in Sources */, 46AE40072092F3A600F3A228 /* node_debug_options.cc in Sources */, 469304122046AE06004A3D6C /* jsb_classtype.cpp in Sources */, 50ABBFFF1926664800A911A9 /* CCFileUtils-apple.mm in Sources */, @@ -3789,7 +3772,6 @@ BA21055921008B6600E19975 /* jsb_cocos2dx_extension_auto.cpp in Sources */, BA06A77423583DFE007740C5 /* GLES2Texture.cc in Sources */, BA06A80423583DFE007740C5 /* GLES3CommandBuffer.cc in Sources */, - 46BFE05723D3F4E900CC5F8E /* jsb_gfx_auto.cpp in Sources */, BA06A6DF23583DBD007740C5 /* GFXQueue.cc in Sources */, BA06A79823583DFE007740C5 /* GLES2RenderPass.cc in Sources */, 1A52DB8E2060DEF500350EE3 /* jsb_platfrom_apple.mm in Sources */, diff --git a/native/cocos/audio/AudioEngine.cpp b/native/cocos/audio/AudioEngine.cpp index 13ad4b8112..b677a666ce 100644 --- a/native/cocos/audio/AudioEngine.cpp +++ b/native/cocos/audio/AudioEngine.cpp @@ -34,17 +34,17 @@ #include #include -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #include "audio/android/AudioEngine-inl.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#elif CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "audio/apple/AudioEngine-inl.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif CC_PLATFORM == CC_PLATFORM_WINDOWS #include "audio/win32/AudioEngine-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WINRT +#elif CC_PLATFORM == CC_PLATFORM_WINRT #include "audio/winrt/AudioEngine-winrt.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif CC_PLATFORM == CC_PLATFORM_LINUX #include "audio/linux/AudioEngine-linux.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN +#elif CC_PLATFORM == CC_PLATFORM_TIZEN #include "audio/tizen/AudioEngine-tizen.h" #endif @@ -195,7 +195,7 @@ bool AudioEngine::lazyInit() } } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +#if (CC_PLATFORM != CC_PLATFORM_ANDROID) if (_audioEngineImpl && s_threadPool == nullptr) { s_threadPool = new (std::nothrow) AudioEngineThreadPool(); diff --git a/native/cocos/audio/android/AudioEngine-inl.cpp b/native/cocos/audio/android/AudioEngine-inl.cpp index fddff20387..01135195d6 100644 --- a/native/cocos/audio/android/AudioEngine-inl.cpp +++ b/native/cocos/audio/android/AudioEngine-inl.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #define LOG_TAG "AudioEngineImpl" diff --git a/native/cocos/audio/android/AudioEngine-inl.h b/native/cocos/audio/android/AudioEngine-inl.h index 75f3b6551f..2413d6229f 100644 --- a/native/cocos/audio/android/AudioEngine-inl.h +++ b/native/cocos/audio/android/AudioEngine-inl.h @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #ifndef __AUDIO_ENGINE_INL_H_ #define __AUDIO_ENGINE_INL_H_ diff --git a/native/cocos/audio/apple/AudioCache.h b/native/cocos/audio/apple/AudioCache.h index 43b911ae93..3c79058eea 100644 --- a/native/cocos/audio/apple/AudioCache.h +++ b/native/cocos/audio/apple/AudioCache.h @@ -26,7 +26,7 @@ #pragma once #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #import diff --git a/native/cocos/audio/apple/AudioCache.mm b/native/cocos/audio/apple/AudioCache.mm index 883b4b91cc..5c803562f5 100644 --- a/native/cocos/audio/apple/AudioCache.mm +++ b/native/cocos/audio/apple/AudioCache.mm @@ -26,7 +26,7 @@ #define LOG_TAG "AudioCache" #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "audio/apple/AudioCache.h" diff --git a/native/cocos/audio/apple/AudioEngine-inl.h b/native/cocos/audio/apple/AudioEngine-inl.h index a7d7ec395f..935e07e1be 100644 --- a/native/cocos/audio/apple/AudioEngine-inl.h +++ b/native/cocos/audio/apple/AudioEngine-inl.h @@ -24,7 +24,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #ifndef __AUDIO_ENGINE_INL_H_ #define __AUDIO_ENGINE_INL_H_ diff --git a/native/cocos/audio/apple/AudioEngine-inl.mm b/native/cocos/audio/apple/AudioEngine-inl.mm index 875c51379b..247f7cdc50 100644 --- a/native/cocos/audio/apple/AudioEngine-inl.mm +++ b/native/cocos/audio/apple/AudioEngine-inl.mm @@ -26,7 +26,7 @@ #define LOG_TAG "AudioEngine-inl.mm" #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "audio/apple/AudioEngine-inl.h" @@ -63,7 +63,7 @@ static ALenum alSourceAddNotificationExt(ALuint sid, ALuint notificationID, alSo return AL_INVALID_VALUE; } -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS @interface AudioEngineSessionHandler : NSObject { } @@ -259,7 +259,7 @@ AudioEngineImpl::~AudioEngineImpl() alcCloseDevice(s_ALDevice); } -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS [s_AudioEngineSessionHandler release]; #endif s_instance = nullptr; @@ -269,7 +269,7 @@ bool AudioEngineImpl::init() { bool ret = false; do{ -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS s_AudioEngineSessionHandler = [[AudioEngineSessionHandler alloc] init]; #endif diff --git a/native/cocos/audio/apple/AudioPlayer.h b/native/cocos/audio/apple/AudioPlayer.h index 3edd4d1fec..b784c6aacc 100644 --- a/native/cocos/audio/apple/AudioPlayer.h +++ b/native/cocos/audio/apple/AudioPlayer.h @@ -26,7 +26,7 @@ #pragma once #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "base/ccMacros.h" #include "audio/apple/AudioMacros.h" diff --git a/native/cocos/audio/apple/AudioPlayer.mm b/native/cocos/audio/apple/AudioPlayer.mm index 140485a8cf..9aab72b932 100644 --- a/native/cocos/audio/apple/AudioPlayer.mm +++ b/native/cocos/audio/apple/AudioPlayer.mm @@ -26,7 +26,7 @@ #define LOG_TAG "AudioPlayer" #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX #import diff --git a/native/cocos/audio/win32/AudioCache.cpp b/native/cocos/audio/win32/AudioCache.cpp index ca5712a858..b90871a05a 100644 --- a/native/cocos/audio/win32/AudioCache.cpp +++ b/native/cocos/audio/win32/AudioCache.cpp @@ -27,7 +27,7 @@ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "audio/win32/AudioCache.h" #include diff --git a/native/cocos/audio/win32/AudioCache.h b/native/cocos/audio/win32/AudioCache.h index 78e0061bac..a576ba18b2 100644 --- a/native/cocos/audio/win32/AudioCache.h +++ b/native/cocos/audio/win32/AudioCache.h @@ -27,7 +27,7 @@ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include #include diff --git a/native/cocos/audio/win32/AudioEngine-win32.cpp b/native/cocos/audio/win32/AudioEngine-win32.cpp index bf81c8c3f5..f5c4b763c7 100644 --- a/native/cocos/audio/win32/AudioEngine-win32.cpp +++ b/native/cocos/audio/win32/AudioEngine-win32.cpp @@ -26,7 +26,7 @@ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "audio/win32/AudioEngine-win32.h" diff --git a/native/cocos/audio/win32/AudioEngine-win32.h b/native/cocos/audio/win32/AudioEngine-win32.h index 7e832c633a..57a2dc50b7 100644 --- a/native/cocos/audio/win32/AudioEngine-win32.h +++ b/native/cocos/audio/win32/AudioEngine-win32.h @@ -24,7 +24,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #ifndef __AUDIO_ENGINE_INL_H_ #define __AUDIO_ENGINE_INL_H_ diff --git a/native/cocos/audio/win32/AudioPlayer.cpp b/native/cocos/audio/win32/AudioPlayer.cpp index fd84d4e02d..3fb961b32f 100644 --- a/native/cocos/audio/win32/AudioPlayer.cpp +++ b/native/cocos/audio/win32/AudioPlayer.cpp @@ -27,7 +27,7 @@ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "audio/win32/AudioPlayer.h" #include "audio/win32/AudioCache.h" #include "platform/CCFileUtils.h" diff --git a/native/cocos/audio/win32/AudioPlayer.h b/native/cocos/audio/win32/AudioPlayer.h index 6b0f860082..7ded81c2b0 100644 --- a/native/cocos/audio/win32/AudioPlayer.h +++ b/native/cocos/audio/win32/AudioPlayer.h @@ -27,7 +27,7 @@ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include #include @@ -93,5 +93,5 @@ protected: NS_CC_END -#endif //CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif //CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/base/CCConfiguration.cpp b/native/cocos/base/CCConfiguration.cpp index 32535101bd..1363c4fabd 100644 --- a/native/cocos/base/CCConfiguration.cpp +++ b/native/cocos/base/CCConfiguration.cpp @@ -119,7 +119,7 @@ void Configuration::gatherGPUInfo() // const char* version = (const char*)glGetString(GL_VERSION); // _valueDict["gl.version"] = Value(version); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) const char* version = (const char*)glGetString(GL_VERSION); _valueDict["gl.version"] = Value(version); if (std::regex_match(version, std::regex("OpenGL ES 3.*"))) { @@ -138,7 +138,7 @@ void Configuration::gatherGPUInfo() // glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &_maxTextureUnits); _valueDict["gl.max_texture_units"] = Value((int)_maxTextureUnits); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) glGetIntegerv(GL_MAX_SAMPLES_APPLE, &_maxSamplesAllowed); _valueDict["gl.max_samples_allowed"] = Value((int)_maxSamplesAllowed); #endif @@ -189,8 +189,6 @@ void Configuration::gatherGPUInfo() _supportsShareableVAO = checkForGLExtension("vertex_array_object"); _valueDict["gl.supports_vertex_array_object"] = Value(_supportsShareableVAO); } - - CHECK_GL_ERROR_DEBUG(); } Configuration* Configuration::getInstance() @@ -324,7 +322,7 @@ bool Configuration::supportsMapBuffer() const // is always implemented in OpenGL. // XXX: Warning. On iOS this is always `true`. Avoiding the comparison. -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) return _supportsOESMapBuffer; #else return true; diff --git a/native/cocos/base/CCLog.cpp b/native/cocos/base/CCLog.cpp index dc9130fb19..d84a086359 100644 --- a/native/cocos/base/CCLog.cpp +++ b/native/cocos/base/CCLog.cpp @@ -28,12 +28,12 @@ #include #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #include #include #include -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif // (CC_PLATFORM == CC_PLATFORM_WINDOWS) /** private functions */ namespace @@ -70,10 +70,10 @@ namespace strcat(buf, "\n"); -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #include __android_log_print(ANDROID_LOG_DEBUG, "debug info", "%s", buf); -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif CC_PLATFORM == CC_PLATFORM_WINDOWS int pos = 0; int len = strlen(buf); char tempBuf[MAX_LOG_LENGTH + 1] = { 0 }; diff --git a/native/cocos/base/CCRenderTexture.cpp b/native/cocos/base/CCRenderTexture.cpp index 75018ecf36..e33f2488dd 100644 --- a/native/cocos/base/CCRenderTexture.cpp +++ b/native/cocos/base/CCRenderTexture.cpp @@ -473,7 +473,7 @@ void RenderTexture::initFramebuffer() ccActiveOffScreenFramebuffer(_FBO); // set up depth buffer and stencil buffer -#if(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if(CC_PLATFORM == CC_PLATFORM_ANDROID) if(Configuration::getInstance()->supportsOESPackedDepthStencil()) { //create and attach depth buffer diff --git a/native/cocos/base/ZipUtils.h b/native/cocos/base/ZipUtils.h index 3107569425..ce857c94e4 100644 --- a/native/cocos/base/ZipUtils.h +++ b/native/cocos/base/ZipUtils.h @@ -32,9 +32,9 @@ THE SOFTWARE. #include "platform/CCFileUtils.h" #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/CCFileUtils-android.h" -#elif(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#elif(CC_PLATFORM == CC_PLATFORM_WINDOWS) || (CC_PLATFORM == CC_PLATFORM_WINRT) // for import ssize_t on win32 platform #include "platform/CCStdC.h" #endif diff --git a/native/cocos/base/base64.cpp b/native/cocos/base/base64.cpp index 54221f6632..f22a11aa45 100644 --- a/native/cocos/base/base64.cpp +++ b/native/cocos/base/base64.cpp @@ -68,7 +68,7 @@ int _base64Decode(const unsigned char *input, unsigned int input_len, unsigned c if( c == '=' ) { switch (char_count) { case 1: -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +#if (CC_PLATFORM != CC_PLATFORM_BADA) fprintf(stderr, "base64Decode: encoding incomplete: at least 2 bits missing"); #endif errors++; @@ -83,7 +83,7 @@ int _base64Decode(const unsigned char *input, unsigned int input_len, unsigned c } } else if ( input_idx < input_len ) { if (char_count) { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) +#if (CC_PLATFORM != CC_PLATFORM_BADA) fprintf(stderr, "base64 encoding incomplete: at least %d bits truncated", ((4 - char_count) * 6)); #endif diff --git a/native/cocos/base/ccConfig.h b/native/cocos/base/ccConfig.h index 086d1e9ff0..af935723b3 100644 --- a/native/cocos/base/ccConfig.h +++ b/native/cocos/base/ccConfig.h @@ -203,7 +203,7 @@ THE SOFTWARE. * To disable it set it to 0. Enabled by default. */ #ifndef CC_TEXTURE_ATLAS_USE_VAO - #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + #if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) || (CC_PLATFORM == CC_PLATFORM_MAC_OSX) #define CC_TEXTURE_ATLAS_USE_VAO 1 #else /* Some Windows display adapter driver cannot support VAO. @@ -322,7 +322,7 @@ THE SOFTWARE. /** Support webp or not. If your application don't use webp format picture, you can undefine this macro to save package size. */ #ifndef CC_USE_WEBP -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) +#if (CC_PLATFORM != CC_PLATFORM_WINRT) #define CC_USE_WEBP 1 #endif #endif // CC_USE_WEBP @@ -330,7 +330,7 @@ THE SOFTWARE. /** Support webp or not. If your application don't use webp format picture, you can undefine this macro to save package size. */ //#ifndef CC_USE_WEBP -//#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) +//#if (CC_PLATFORM != CC_PLATFORM_WINRT) //#define CC_USE_WEBP 1 //#endif //#endif // CC_USE_WEBP @@ -338,7 +338,7 @@ THE SOFTWARE. /** Support WIC (Windows Image Component) or not. Replaces PNG, TIFF and JPEG */ #ifndef CC_USE_WIC -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_PLATFORM == CC_PLATFORM_WINRT) #define CC_USE_WIC 1 #undef CC_USE_TIFF #undef CC_USE_JPEG diff --git a/native/cocos/base/ccMacros.h b/native/cocos/base/ccMacros.h index 3bbba7279f..e57c27e524 100644 --- a/native/cocos/base/ccMacros.h +++ b/native/cocos/base/ccMacros.h @@ -36,7 +36,7 @@ THE SOFTWARE. #include "base/CCLog.h" #include "base/ccConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #include #ifndef __SSIZE_T #define __SSIZE_T @@ -84,17 +84,6 @@ typedef SSIZE_T ssize_t; TypeName(const TypeName&);\ void operator=(const TypeName&) - - /** @def CC_SWAP - simple macro that swaps 2 variables - @deprecated use std::swap() instead - */ -#define CC_SWAP(x, y, type) \ -{ type temp = (x); \ - x = y; y = temp; \ -} - - /** Helper macros which converts 4-byte little/big endian integral number to the machine native number representation @@ -111,46 +100,6 @@ It should work same as apples CFSwapInt32LittleToHost(..) #define CC_SWAP_INT32_BIG_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true)? (i) : CC_SWAP32(i) ) #define CC_SWAP_INT16_BIG_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true)? (i): CC_SWAP16(i) ) -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 -#define CHECK_GL_ERROR_DEBUG() -#else -#define CHECK_GL_ERROR_DEBUG() \ -// do { \ -// GLenum __error = glGetError(); \ -// if(__error) { \ -// cocos2d::log("OpenGL error 0x%04X in %s %s %d\n", __error, __FILE__, __FUNCTION__, __LINE__); \ -// } \ -// } while (false) -#endif // !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 - -/** - * GL assertion that can be used for any OpenGL function call. - * - * This macro will assert if an error is detected when executing - * the specified GL code. This macro will do nothing in release - * mode and is therefore safe to use for realtime/per-frame GL - * function calls. - */ -#if defined(NDEBUG) || (defined(__APPLE__) && !defined(DEBUG)) -#define CC_GL_ASSERT( gl_code ) gl_code -#else -#define CC_GL_ASSERT( gl_code ) do \ -//{ \ -//gl_code; \ -//__gl_error_code = glGetError(); \ -//CC_ASSERT(__gl_error_code == GL_NO_ERROR, "Error"); \ -} while(0) -#endif // defined(NDEBUG) || (defined(__APPLE__) && !defined(DEBUG)) - - /*********************************/ - /** 64bits Program Sense Macros **/ - /*********************************/ -#if defined(_M_X64) || defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(__x86_64) -#define CC_64BITS 1 -#else -#define CC_64BITS 0 -#endif - // new callbacks based on C++11 #define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__) #define CC_CALLBACK_1(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, ##__VA_ARGS__) @@ -196,7 +145,7 @@ It should work same as apples CFSwapInt32LittleToHost(..) #elif COCOS2D_DEBUG == 1 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #define COCOS_LOG_TAG "cocos2d-x" #define CCLOG(...) __android_log_print(ANDROID_LOG_DEBUG, COCOS_LOG_TAG, __VA_ARGS__) #define CCLOGINFO(format,...) do {} while (0) @@ -253,43 +202,8 @@ It should work same as apples CFSwapInt32LittleToHost(..) */ #define CC_DEPRECATED(...) CC_DEPRECATED_ATTRIBUTE -/** @def CC_FORMAT_PRINTF(formatPos, argPos) -* Only certain compiler support __attribute__((format)) -* -* @param formatPos 1-based position of format string argument. -* @param argPos 1-based position of first format-dependent argument. -*/ -#if defined(__GNUC__) && (__GNUC__ >= 4) -#define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) -#elif defined(__has_attribute) -#if __has_attribute(format) -#define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) -#endif // __has_attribute(format) -#else -#define CC_FORMAT_PRINTF(formatPos, argPos) -#endif - -#if defined(_MSC_VER) -#define CC_FORMAT_PRINTF_SIZE_T "%08lX" -#else -#define CC_FORMAT_PRINTF_SIZE_T "%08zX" -#endif - #ifdef __GNUC__ #define CC_UNUSED __attribute__ ((unused)) #else #define CC_UNUSED #endif - -/** @def CC_REQUIRES_NULL_TERMINATION -* -*/ -#if !defined(CC_REQUIRES_NULL_TERMINATION) -#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549) -#define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0,1))) -#elif defined(__GNUC__) -#define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) -#else -#define CC_REQUIRES_NULL_TERMINATION -#endif -#endif diff --git a/native/cocos/base/ccUTF8.cpp b/native/cocos/base/ccUTF8.cpp index 6cefc52e7c..82726e6d2d 100644 --- a/native/cocos/base/ccUTF8.cpp +++ b/native/cocos/base/ccUTF8.cpp @@ -229,7 +229,7 @@ bool UTF32ToUTF16(const std::u32string& utf32, std::u16string& outUtf16) return utfConvert(utf32, outUtf16, ConvertUTF32toUTF16); } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret) { std::string utf8Str; diff --git a/native/cocos/base/ccUTF8.h b/native/cocos/base/ccUTF8.h index 468c29a79c..0659da6a0a 100644 --- a/native/cocos/base/ccUTF8.h +++ b/native/cocos/base/ccUTF8.h @@ -32,7 +32,7 @@ #include #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/jni/JniHelper.h" #endif @@ -109,7 +109,7 @@ CC_DLL bool UTF32ToUTF16(const std::u32string& inUtf32, std::u16string& outUtf16 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) /** diff --git a/native/cocos/base/ccUtils.cpp b/native/cocos/base/ccUtils.cpp index f4fb5fae4d..065695da8c 100644 --- a/native/cocos/base/ccUtils.cpp +++ b/native/cocos/base/ccUtils.cpp @@ -35,7 +35,7 @@ NS_CC_BEGIN namespace { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "platform/CCStdC.h" int gettimeofday(struct timeval * val, void *) { diff --git a/native/cocos/base/ccUtils.h b/native/cocos/base/ccUtils.h index ce466b6859..f83442ec28 100644 --- a/native/cocos/base/ccUtils.h +++ b/native/cocos/base/ccUtils.h @@ -37,7 +37,7 @@ NS_CC_BEGIN namespace { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #include extern "C" int gettimeofday(struct timeval * val, void *); #endif diff --git a/native/cocos/cocos2d.h b/native/cocos/cocos2d.h index 29ef4cba2f..055a640973 100644 --- a/native/cocos/cocos2d.h +++ b/native/cocos/cocos2d.h @@ -79,18 +79,18 @@ THE SOFTWARE. #include "platform/CCSAXParser.h" #include "platform/CCCanvasRenderingContext2D.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/CCGL-android.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#endif // CC_PLATFORM == CC_PLATFORM_ANDROID -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "platform/win32/CCGL-win32.h" #include "platform/win32/CCStdC-win32.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // CC_PLATFORM == CC_PLATFORM_WINDOWS -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) #include "platform/mac/CCGL-mac.h" -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#endif // CC_PLATFORM == CC_PLATFORM_MAC_OSX NS_CC_BEGIN diff --git a/native/cocos/math/MathUtil.cpp b/native/cocos/math/MathUtil.cpp index ea31a7a82d..494f87d1cc 100644 --- a/native/cocos/math/MathUtil.cpp +++ b/native/cocos/math/MathUtil.cpp @@ -23,7 +23,7 @@ This file was modified to fit the cocos2d-x project #include "math/MathUtil.h" #include "base/ccMacros.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include #endif @@ -34,7 +34,7 @@ This file was modified to fit the cocos2d-x project //#define USE_SSE : SSE code used //#define INCLUDE_SSE : SSE code included -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) #if defined (__arm64__) #define USE_NEON64 #define INCLUDE_NEON64 @@ -43,7 +43,7 @@ This file was modified to fit the cocos2d-x project #define INCLUDE_NEON32 #else #endif -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) #if defined (__arm64__) || defined (__aarch64__) #define USE_NEON64 #define INCLUDE_NEON64 @@ -106,7 +106,7 @@ bool MathUtil::isNeon32Enabled() { #ifdef USE_NEON32 return true; -#elif (defined (INCLUDE_NEON32) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) ) +#elif (defined (INCLUDE_NEON32) && (CC_PLATFORM == CC_PLATFORM_ANDROID) ) class AndroidNeonChecker { public: diff --git a/native/cocos/network/CCDownloader.cpp b/native/cocos/network/CCDownloader.cpp index 90c8abb2ce..829cc0eb64 100644 --- a/native/cocos/network/CCDownloader.cpp +++ b/native/cocos/network/CCDownloader.cpp @@ -27,12 +27,12 @@ #include "network/CCDownloader.h" // include platform specific implement class -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_MAC_IOS) #include "network/CCDownloaderImpl-apple.h" #define DownloaderImpl DownloaderApple -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) #include "network/CCDownloader-android.h" #define DownloaderImpl DownloaderAndroid diff --git a/native/cocos/network/HttpAsynConnection-apple.h b/native/cocos/network/HttpAsynConnection-apple.h index 9ff32d6926..5e1b00db3e 100644 --- a/native/cocos/network/HttpAsynConnection-apple.h +++ b/native/cocos/network/HttpAsynConnection-apple.h @@ -28,7 +28,7 @@ /// @cond DO_NOT_SHOW #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) || (CC_PLATFORM == CC_PLATFORM_MAC_IOS) #import #import @@ -65,7 +65,7 @@ @end -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif // #if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) || (CC_PLATFORM == CC_PLATFORM_MAC_IOS) /// @endcond #endif //__HTTPASYNCONNECTION_H__ diff --git a/native/cocos/network/HttpAsynConnection-apple.m b/native/cocos/network/HttpAsynConnection-apple.m index 44d9a83f1a..206d5590d4 100755 --- a/native/cocos/network/HttpAsynConnection-apple.m +++ b/native/cocos/network/HttpAsynConnection-apple.m @@ -23,7 +23,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) || (CC_PLATFORM == CC_PLATFORM_MAC_IOS) #import "network/HttpAsynConnection-apple.h" @@ -227,4 +227,4 @@ @end -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#endif // #if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) || (CC_PLATFORM == CC_PLATFORM_MAC_IOS) diff --git a/native/cocos/network/HttpClient-android.cpp b/native/cocos/network/HttpClient-android.cpp index 2fe9b39753..e51a102797 100644 --- a/native/cocos/network/HttpClient-android.cpp +++ b/native/cocos/network/HttpClient-android.cpp @@ -26,7 +26,7 @@ ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include "network/HttpClient.h" @@ -1117,4 +1117,4 @@ const std::string& HttpClient::getSSLVerification() NS_CC_END -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#endif // #if (CC_PLATFORM == CC_PLATFORM_ANDROID) diff --git a/native/cocos/network/HttpClient.cpp b/native/cocos/network/HttpClient.cpp index bbf65a71ca..3fb7891a28 100644 --- a/native/cocos/network/HttpClient.cpp +++ b/native/cocos/network/HttpClient.cpp @@ -36,7 +36,7 @@ NS_CC_BEGIN namespace network { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) typedef int int32_t; #endif diff --git a/native/cocos/network/HttpRequest.h b/native/cocos/network/HttpRequest.h index 73d87f2cd7..0a8060f2bb 100644 --- a/native/cocos/network/HttpRequest.h +++ b/native/cocos/network/HttpRequest.h @@ -57,7 +57,7 @@ typedef std::function * @lua NA */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_PLATFORM == CC_PLATFORM_WINRT) #ifdef DELETE #undef DELETE #endif diff --git a/native/cocos/network/WebSocket-libwebsockets.cpp b/native/cocos/network/WebSocket-libwebsockets.cpp index db3645a728..6f9bd4d76d 100644 --- a/native/cocos/network/WebSocket-libwebsockets.cpp +++ b/native/cocos/network/WebSocket-libwebsockets.cpp @@ -59,7 +59,7 @@ struct lws; struct lws_protocols; struct lws_vhost; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) // log, CCLOG aren't threadsafe, since we uses sub threads for parsing pcm data, threadsafe log output // is needed. Define the following macros (ALOGV, ALOGD, ALOGI, ALOGW, ALOGE) for threadsafe log output. @@ -262,7 +262,7 @@ static std::mutex __instanceMutex; static struct lws_context* __wsContext = nullptr; static WsThreadHelper* __wsHelper = nullptr; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) static std::string getFileNameForPath(const std::string& filePath) { std::string fileName = filePath; @@ -914,7 +914,7 @@ struct lws_vhost* WebSocketImpl::createVhost(struct lws_protocols* protocols, in { if (isCAFileExist) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) // if ca file is in the apk, try to extract it to writable path std::string writablePath = fileUtils->getWritablePath(); std::string caFileName = getFileNameForPath(_caFilePath); diff --git a/native/cocos/platform/CCFileUtils.cpp b/native/cocos/platform/CCFileUtils.cpp index 1e43dcaf3b..b53fe6ee5c 100644 --- a/native/cocos/platform/CCFileUtils.cpp +++ b/native/cocos/platform/CCFileUtils.cpp @@ -47,7 +47,7 @@ NS_CC_BEGIN // Implement DictMaker -#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#if (CC_PLATFORM != CC_PLATFORM_MAC_IOS) && (CC_PLATFORM != CC_PLATFORM_MAC_OSX) typedef enum { @@ -544,7 +544,7 @@ ValueMap FileUtils::getValueMapFromData(const char* filedata, int filesize) {ret ValueVector FileUtils::getValueVectorFromFile(const std::string& filename) {return ValueVector();} bool FileUtils::writeToFile(const ValueMap& dict, const std::string &fullPath) {return false;} -#endif /* (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) */ +#endif /* (CC_PLATFORM != CC_PLATFORM_MAC_IOS) && (CC_PLATFORM != CC_PLATFORM_MAC_OSX) */ // Implement FileUtils FileUtils* FileUtils::s_sharedFileUtils = nullptr; @@ -1187,7 +1187,7 @@ void FileUtils::listFilesRecursively(const std::string& dirPath, std::vector // android doesn't have ftw.h -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +#if (CC_PLATFORM != CC_PLATFORM_ANDROID) #include #endif @@ -1323,7 +1323,7 @@ bool FileUtils::createDirectory(const std::string& path) namespace { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +#if (CC_PLATFORM != CC_PLATFORM_ANDROID) int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) { int rv = remove(fpath); @@ -1340,7 +1340,7 @@ bool FileUtils::removeDirectory(const std::string& path) { #if !defined(CC_TARGET_OS_TVOS) -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +#if (CC_PLATFORM != CC_PLATFORM_ANDROID) if (nftw(path.c_str(), unlink_cb, 64, FTW_DEPTH | FTW_PHYS) == -1) return false; else @@ -1353,7 +1353,7 @@ bool FileUtils::removeDirectory(const std::string& path) return true; else return false; -#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +#endif // (CC_PLATFORM != CC_PLATFORM_ANDROID) #else return false; diff --git a/native/cocos/platform/CCGL.h b/native/cocos/platform/CCGL.h index 53f6b03f7b..27294ac29e 100644 --- a/native/cocos/platform/CCGL.h +++ b/native/cocos/platform/CCGL.h @@ -99,17 +99,17 @@ THE SOFTWARE. #define GL_DEPTH_STENCIL 0x84F9 #endif -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "platform/mac/CCGL-mac.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif CC_PLATFORM == CC_PLATFORM_MAC_IOS #include "platform/ios/CCGL-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif CC_PLATFORM == CC_PLATFORM_ANDROID #include "platform/android/CCGL-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif CC_PLATFORM == CC_PLATFORM_WINDOWS #include "platform/win32/CCGL-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WINRT +#elif CC_PLATFORM == CC_PLATFORM_WINRT #include "platform/winrt/CCGL.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif CC_PLATFORM == CC_PLATFORM_LINUX #include "platform/linux/CCGL-linux.h" #endif diff --git a/native/cocos/platform/CCImage.cpp b/native/cocos/platform/CCImage.cpp index 96ad3c635e..ac919d549f 100644 --- a/native/cocos/platform/CCImage.cpp +++ b/native/cocos/platform/CCImage.cpp @@ -46,7 +46,7 @@ extern "C" { // To resolve link error when building 32bits with Xcode 6. // More information please refer to the discussion in https://github.com/cocos2d/cocos2d-x/pull/6986 -#if defined (__unix) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if defined (__unix) || (CC_PLATFORM == CC_PLATFORM_MAC_IOS) #ifndef __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ #define __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ #include @@ -93,7 +93,7 @@ extern "C" #include "platform/CCFileUtils.h" #include "base/CCConfiguration.h" #include "base/ZipUtils.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/CCFileUtils-android.h" #endif @@ -958,7 +958,7 @@ bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen) info_ptr = png_create_info_struct(png_ptr); CC_BREAK_IF(!info_ptr); -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA && CC_TARGET_PLATFORM != CC_PLATFORM_NACL) +#if (CC_PLATFORM != CC_PLATFORM_BADA && CC_PLATFORM != CC_PLATFORM_NACL) CC_BREAK_IF(setjmp(png_jmpbuf(png_ptr))); #endif @@ -1812,7 +1812,7 @@ bool Image::initWithWebpData(const unsigned char * data, ssize_t dataLen) #if CC_USE_WEBP bool ret = false; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_PLATFORM == CC_PLATFORM_WINRT) CCLOG("WEBP image format not supported on WinRT or WP8"); #else do @@ -1847,7 +1847,7 @@ bool Image::initWithWebpData(const unsigned char * data, ssize_t dataLen) ret = true; } while (0); -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#endif // (CC_PLATFORM == CC_PLATFORM_WINRT) return ret; #else CCLOG("webp is not enabled, please enable it in ccConfig.h"); @@ -1881,7 +1881,7 @@ bool Image::initWithRawData(const unsigned char * data, ssize_t dataLen, int wid } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) +#if (CC_PLATFORM != CC_PLATFORM_MAC_IOS) bool Image::saveToFile(const std::string& filename, bool isToRGB) { //only support for Image::PixelFormat::RGB888 or Image::PixelFormat::RGBA8888 uncompressed data @@ -1907,7 +1907,7 @@ bool Image::saveToFile(const std::string& filename, bool isToRGB) return false; } } -#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) +#endif // (CC_PLATFORM != CC_PLATFORM_MAC_IOS) bool Image::saveImageToPNG(const std::string& filePath, bool isToRGB) { @@ -1941,7 +1941,7 @@ bool Image::saveImageToPNG(const std::string& filePath, bool isToRGB) png_destroy_write_struct(&png_ptr, nullptr); break; } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA && CC_TARGET_PLATFORM != CC_PLATFORM_NACL) +#if (CC_PLATFORM != CC_PLATFORM_BADA && CC_PLATFORM != CC_PLATFORM_NACL) if (setjmp(png_jmpbuf(png_ptr))) { fclose(fp); diff --git a/native/cocos/platform/CCPlatformConfig.h b/native/cocos/platform/CCPlatformConfig.h index 9be405d878..799b3ee095 100644 --- a/native/cocos/platform/CCPlatformConfig.h +++ b/native/cocos/platform/CCPlatformConfig.h @@ -23,132 +23,43 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#pragma once -#ifndef __BASE_CC_PLATFORM_CONFIG_H__ -#define __BASE_CC_PLATFORM_CONFIG_H__ /// @cond DO_NOT_SHOW -/** - Config of cocos2d-x project, per target platform. +// Initial platform stuff to set. +#define CC_PLATFORM_WINDOWS 1 +#define CC_PLATFORM_LINUX 2 +#define CC_PLATFORM_MAC_OSX 3 +#define CC_PLATFORM_MAC_IOS 4 +#define CC_PLATFORM_ANDROID 5 +#define CC_PLATFORM_NACL 6 - THIS FILE MUST NOT INCLUDE ANY OTHER FILE -*/ - -////////////////////////////////////////////////////////////////////////// -// pre configure -////////////////////////////////////////////////////////////////////////// - -// define supported target platform macro which CC uses. -#define CC_PLATFORM_UNKNOWN 0 -#define CC_PLATFORM_IOS 1 -#define CC_PLATFORM_ANDROID 2 -#define CC_PLATFORM_WIN32 3 -#define CC_PLATFORM_MARMALADE 4 -#define CC_PLATFORM_LINUX 5 -#define CC_PLATFORM_BADA 6 -#define CC_PLATFORM_BLACKBERRY 7 -#define CC_PLATFORM_MAC 8 -#define CC_PLATFORM_NACL 9 -#define CC_PLATFORM_EMSCRIPTEN 10 -#define CC_PLATFORM_TIZEN 11 -#define CC_PLATFORM_QT5 12 -#define CC_PLATFORM_WINRT 13 - -// Determine target platform by compile environment macro. -#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN - -// Apple: Mac and iOS -#if defined(__APPLE__) && !defined(ANDROID) // exclude android for binding generator. - #include - #if TARGET_OS_IPHONE // TARGET_OS_IPHONE includes TARGET_OS_IOS TARGET_OS_TV and TARGET_OS_WATCH. see TargetConditionals.h - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_IOS - #elif TARGET_OS_MAC - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_MAC - #endif +// Platform recognition +#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(_WIN64) || defined(__WIN64__) || defined(WIN64) +# define CC_PLATFORM CC_PLATFORM_WINDOWS +#elif defined(__APPLE_CC__) +// Device Simulator +// Both requiring OS version 4.0 or greater +# if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 +# define CC_PLATFORM CC_PLATFORM_MAC_IOS +# else +# define CC_PLATFORM CC_PLATFORM_MAC_OSX +# endif +#elif defined(__ANDROID__) +# define CC_PLATFORM CC_PLATFORM_ANDROID +#elif defined(linux) || defined(__linux) || defined(__linux__) +# define CC_PLATFORM CC_PLATFORM_LINUX +#elif defined(__native_client__) +# define CC_PLATFORM CC_PLATFORM_NACL +#else +# error "Couldn't recognize platform" #endif -// android -#if defined(ANDROID) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID -#endif - -// win32 -#if defined(_WIN32) && defined(_WINDOWS) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_WIN32 -#endif - -// linux -#if defined(LINUX) && !defined(__APPLE__) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_LINUX -#endif - -// marmalade -#if defined(MARMALADE) -#undef CC_TARGET_PLATFORM -#define CC_TARGET_PLATFORM CC_PLATFORM_MARMALADE -#endif - -// bada -#if defined(SHP) -#undef CC_TARGET_PLATFORM -#define CC_TARGET_PLATFORM CC_PLATFORM_BADA -#endif - -// qnx -#if defined(__QNX__) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_BLACKBERRY -#endif - -// native client -#if defined(__native_client__) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_NACL -#endif - -// Emscripten -#if defined(EMSCRIPTEN) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_EMSCRIPTEN -#endif - -// tizen -#if defined(TIZEN) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_TIZEN -#endif - -// qt5 -#if defined(CC_TARGET_QT5) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_QT5 -#endif - -// WinRT (Windows 8.1 Store/Phone App) -#if defined(WINRT) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_WINRT -#endif - -////////////////////////////////////////////////////////////////////////// -// post configure -////////////////////////////////////////////////////////////////////////// - -// check user set platform -#if ! CC_TARGET_PLATFORM - #error "Cannot recognize the target platform; are you targeting an unsupported platform?" -#endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #ifndef __MINGW32__ #pragma warning (disable:4127) #endif -#endif // CC_PLATFORM_WIN32 +#endif /// @endcond -#endif // __BASE_CC_PLATFORM_CONFIG_H__ diff --git a/native/cocos/platform/CCPlatformDefine.h b/native/cocos/platform/CCPlatformDefine.h index b60c764dcf..efefbee7e2 100644 --- a/native/cocos/platform/CCPlatformDefine.h +++ b/native/cocos/platform/CCPlatformDefine.h @@ -30,17 +30,17 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "platform/mac/CCPlatformDefine-mac.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#elif CC_PLATFORM == CC_PLATFORM_MAC_IOS #include "platform/ios/CCPlatformDefine-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif CC_PLATFORM == CC_PLATFORM_ANDROID #include "platform/android/CCPlatformDefine-android.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#elif CC_PLATFORM == CC_PLATFORM_WINDOWS #include "platform/win32/CCPlatformDefine-win32.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_WINRT +#elif CC_PLATFORM == CC_PLATFORM_WINRT #include "platform/winrt/CCPlatformDefine-winrt.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX +#elif CC_PLATFORM == CC_PLATFORM_LINUX #include "platform/linux/CCPlatformDefine-linux.h" #endif diff --git a/native/cocos/platform/CCStdC.h b/native/cocos/platform/CCStdC.h index 974010d814..8c9669ad3f 100644 --- a/native/cocos/platform/CCStdC.h +++ b/native/cocos/platform/CCStdC.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #define WIN32_LEAN_AND_MEAN #include @@ -80,4 +80,4 @@ THE SOFTWARE. #include #include -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/platform/android/CCDevice-android.cpp b/native/cocos/platform/android/CCDevice-android.cpp index b363e8dc04..a71fb45641 100644 --- a/native/cocos/platform/android/CCDevice-android.cpp +++ b/native/cocos/platform/android/CCDevice-android.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #include "platform/CCDevice.h" #include @@ -127,4 +127,4 @@ cocos2d::Vec4 Device::getSafeAreaEdge() NS_CC_END -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#endif // CC_PLATFORM == CC_PLATFORM_ANDROID diff --git a/native/cocos/platform/android/CCFileUtils-android.cpp b/native/cocos/platform/android/CCFileUtils-android.cpp index c571454648..b24f70f491 100644 --- a/native/cocos/platform/android/CCFileUtils-android.cpp +++ b/native/cocos/platform/android/CCFileUtils-android.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #include "platform/android/CCFileUtils-android.h" #include "platform/android/jni/JniHelper.h" @@ -330,4 +330,4 @@ std::string FileUtilsAndroid::getWritablePath() const NS_CC_END -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#endif // CC_PLATFORM == CC_PLATFORM_ANDROID diff --git a/native/cocos/platform/android/CCFileUtils-android.h b/native/cocos/platform/android/CCFileUtils-android.h index d50bb11593..10695ffcb1 100644 --- a/native/cocos/platform/android/CCFileUtils-android.h +++ b/native/cocos/platform/android/CCFileUtils-android.h @@ -27,7 +27,7 @@ Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. #define __CC_FILEUTILS_ANDROID_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #include "platform/CCFileUtils.h" #include "base/ccMacros.h" @@ -85,6 +85,6 @@ private: NS_CC_END -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#endif // CC_PLATFORM == CC_PLATFORM_ANDROID #endif // __CC_FILEUTILS_ANDROID_H__ diff --git a/native/cocos/platform/android/CCGL-android.h b/native/cocos/platform/android/CCGL-android.h index c80afea31b..b3e3038dea 100644 --- a/native/cocos/platform/android/CCGL-android.h +++ b/native/cocos/platform/android/CCGL-android.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCGL_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #define glClearDepth glClearDepthf #define glDeleteVertexArrays glDeleteVertexArraysOES @@ -75,7 +75,7 @@ extern PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOESEXT; #define glDeleteVertexArraysOES glDeleteVertexArraysOESEXT -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#endif // CC_PLATFORM == CC_PLATFORM_ANDROID #endif // __CCGL_H__ diff --git a/native/cocos/platform/android/CCPlatformDefine-android.h b/native/cocos/platform/android/CCPlatformDefine-android.h index 3183f394c5..54101a1623 100644 --- a/native/cocos/platform/android/CCPlatformDefine-android.h +++ b/native/cocos/platform/android/CCPlatformDefine-android.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCPLATFORMDEFINE_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #include @@ -63,6 +63,6 @@ THE SOFTWARE. #endif #endif -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#endif // CC_PLATFORM == CC_PLATFORM_ANDROID #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm b/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm index 320f74f90e..b60f083b82 100644 --- a/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm +++ b/native/cocos/platform/apple/CCCanvasRenderingContext2D-apple.mm @@ -7,7 +7,7 @@ #import -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX #import #else #import @@ -44,7 +44,7 @@ enum class CanvasTextBaseline { CGFloat _height; CGContextRef _context; -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX NSGraphicsContext* _currentGraphicsContext; NSGraphicsContext* _oldGraphicsContext; #else @@ -90,7 +90,7 @@ enum class CanvasTextBaseline { _context = nil; _colorSpace = nil; -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX _currentGraphicsContext = nil; _oldGraphicsContext = nil; #endif @@ -110,13 +110,13 @@ enum class CanvasTextBaseline { // release the context CGContextRelease(_context); [_path release]; -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX [_currentGraphicsContext release]; #endif [super dealloc]; } -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX -(NSFont*) _createSystemFont { NSFontTraitMask mask = NSUnitalicFontMask; @@ -225,7 +225,7 @@ enum class CanvasTextBaseline { _context = nil; } -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX if (_currentGraphicsContext != nil) { [_currentGraphicsContext release]; @@ -248,7 +248,7 @@ enum class CanvasTextBaseline { _colorSpace = nil; } -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX _currentGraphicsContext = [NSGraphicsContext graphicsContextWithCGContext:_context flipped: NO]; [_currentGraphicsContext retain]; #else @@ -291,7 +291,7 @@ enum class CanvasTextBaseline { point.x -= textSize.width; } -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX // The origin on macOS is bottom-left by default, // so we need to convert y from top-left origin to bottom-left origin. point.y = _height - point.y; @@ -438,7 +438,7 @@ enum class CanvasTextBaseline { NSColor* color = [NSColor colorWithRed:_fillStyle.r green:_fillStyle.g blue:_fillStyle.b alpha:_fillStyle.a]; [color setFill]; -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX CGRect tmpRect = CGRectMake(rect.origin.x, _height - rect.origin.y - rect.size.height, rect.size.width, rect.size.height); [NSBezierPath fillRect:tmpRect]; #else @@ -449,7 +449,7 @@ enum class CanvasTextBaseline { } -(void) saveContext { -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX // save the old graphics context _oldGraphicsContext = [NSGraphicsContext currentContext]; // store the current context @@ -467,7 +467,7 @@ enum class CanvasTextBaseline { } -(void) restoreContext { -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX // pop the context [NSGraphicsContext restoreGraphicsState]; // reset the old graphics context @@ -494,7 +494,7 @@ enum class CanvasTextBaseline { } -(void) moveToX: (float) x y:(float) y { -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX [_path moveToPoint: NSMakePoint(x, _height - y)]; #else [_path moveToPoint: NSMakePoint(x, y)]; @@ -502,7 +502,7 @@ enum class CanvasTextBaseline { } -(void) lineToX: (float) x y:(float) y { -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX [_path lineToPoint: NSMakePoint(x, _height - y)]; #else [_path addLineToPoint: NSMakePoint(x, y)]; diff --git a/native/cocos/platform/desktop/CCGLView-desktop.cpp b/native/cocos/platform/desktop/CCGLView-desktop.cpp index c0b1127f75..05c59e7615 100644 --- a/native/cocos/platform/desktop/CCGLView-desktop.cpp +++ b/native/cocos/platform/desktop/CCGLView-desktop.cpp @@ -446,7 +446,7 @@ void GLView::onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int heig EventDispatcher::dispatchResizeEvent(width, height); } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) static bool glew_dynamic_binding() { const char *gl_extensions = (const char*)glGetString(GL_EXTENSIONS); @@ -524,7 +524,7 @@ void GLView::computeScale() // helper bool GLView::initGlew() { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#if (CC_PLATFORM != CC_PLATFORM_MAC_OSX) GLenum GlewInitResult = glewInit(); if (GLEW_OK != GlewInitResult) { @@ -550,7 +550,7 @@ bool GLView::initGlew() log("OpenGL 2.0 not supported"); } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) if(glew_dynamic_binding() == false) { log("No OpenGL framebuffer support. Please upgrade the driver of your video card.", "OpenGL error"); @@ -558,7 +558,7 @@ bool GLView::initGlew() } #endif -#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#endif // (CC_PLATFORM != CC_PLATFORM_MAC_OSX) return true; } diff --git a/native/cocos/platform/desktop/CCGLView-desktop.h b/native/cocos/platform/desktop/CCGLView-desktop.h index dd2f5b6abf..8f8ab81aa1 100644 --- a/native/cocos/platform/desktop/CCGLView-desktop.h +++ b/native/cocos/platform/desktop/CCGLView-desktop.h @@ -32,7 +32,7 @@ THE SOFTWARE. #include "glfw3/glfw3.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #ifndef GLFW_EXPOSE_NATIVE_WIN32 #define GLFW_EXPOSE_NATIVE_WIN32 #endif @@ -40,9 +40,9 @@ THE SOFTWARE. #define GLFW_EXPOSE_NATIVE_WGL #endif #include "glfw3/glfw3native.h" -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ +#endif /* (CC_PLATFORM == CC_PLATFORM_WINDOWS) */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) #ifndef GLFW_EXPOSE_NATIVE_NSGL #define GLFW_EXPOSE_NATIVE_NSGL #endif @@ -50,7 +50,7 @@ THE SOFTWARE. #define GLFW_EXPOSE_NATIVE_COCOA #endif #include "glfw3/glfw3native.h" -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#endif // #if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) NS_CC_BEGIN diff --git a/native/cocos/platform/ios/CCGL-ios.h b/native/cocos/platform/ios/CCGL-ios.h index c5173a5e2c..af719e114a 100644 --- a/native/cocos/platform/ios/CCGL-ios.h +++ b/native/cocos/platform/ios/CCGL-ios.h @@ -27,7 +27,7 @@ THE SOFTWARE. #pragma once #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS #include #include @@ -47,4 +47,4 @@ THE SOFTWARE. #define GL_MAX_TEXTURE_UNITS GL_MAX_TEXTURE_IMAGE_UNITS //#define GL_MAX_SAMPLES_APPLE GL_MAX_SAMPLES -#endif // CC_PLATFORM_IOS +#endif // CC_PLATFORM_MAC_IOS diff --git a/native/cocos/platform/ios/CCImage-ios.mm b/native/cocos/platform/ios/CCImage-ios.mm index eaa8822e4a..72f5eb09f4 100644 --- a/native/cocos/platform/ios/CCImage-ios.mm +++ b/native/cocos/platform/ios/CCImage-ios.mm @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS #import "platform/CCImage.h" #import @@ -123,5 +123,5 @@ bool cocos2d::Image::saveToFile(const std::string& filename, bool isToRGB) NS_CC_END -#endif // CC_PLATFORM_IOS +#endif // CC_PLATFORM_MAC_IOS diff --git a/native/cocos/platform/ios/CCPlatformDefine-ios.h b/native/cocos/platform/ios/CCPlatformDefine-ios.h index 502772bcf9..0d4aca35ce 100644 --- a/native/cocos/platform/ios/CCPlatformDefine-ios.h +++ b/native/cocos/platform/ios/CCPlatformDefine-ios.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CCPLATFORMDEFINE_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS #include @@ -48,7 +48,7 @@ THE SOFTWARE. #endif -#endif // CC_PLATFORM_IOS +#endif // CC_PLATFORM_MAC_IOS #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/native/cocos/platform/ios/CCReachability.cpp b/native/cocos/platform/ios/CCReachability.cpp index 0142cba854..2c6bba0dcd 100644 --- a/native/cocos/platform/ios/CCReachability.cpp +++ b/native/cocos/platform/ios/CCReachability.cpp @@ -41,7 +41,7 @@ namespace { #if ShouldPrintReachabilityFlags printf("Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', #else '-', @@ -95,7 +95,7 @@ namespace { } } -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) { /* diff --git a/native/cocos/platform/ios/OpenGL_Internal-ios.h b/native/cocos/platform/ios/OpenGL_Internal-ios.h index 0a31549427..d317b9b655 100644 --- a/native/cocos/platform/ios/OpenGL_Internal-ios.h +++ b/native/cocos/platform/ios/OpenGL_Internal-ios.h @@ -62,7 +62,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. */ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS /* Generic error reporting */ #define REPORT_ERROR(__FORMAT__, ...) printf("%s: %s\n", __FUNCTION__, [[NSString stringWithFormat:__FORMAT__, __VA_ARGS__] UTF8String]) @@ -83,5 +83,5 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #define TEST_DELEGATE_METHOD_BIT(__BIT__) (self->__DELEGATE_METHODS_IVAR__ & (1 << __BIT__)) #define SET_DELEGATE_METHOD_BIT(__BIT__, __NAME__) { if([self->__DELEGATE_IVAR__ respondsToSelector:@selector(__NAME__)]) self->__DELEGATE_METHODS_IVAR__ |= (1 << __BIT__); else self->__DELEGATE_METHODS_IVAR__ &= ~(1 << __BIT__); } -#endif // CC_PLATFORM_IOS +#endif // CC_PLATFORM_MAC_IOS diff --git a/native/cocos/platform/mac/CCDevice-mac.mm b/native/cocos/platform/mac/CCDevice-mac.mm index 20b604f7b8..fbdcedb767 100644 --- a/native/cocos/platform/mac/CCDevice-mac.mm +++ b/native/cocos/platform/mac/CCDevice-mac.mm @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX #include "platform/CCDevice.h" #include "platform/apple/CCDevice-apple.h" @@ -125,4 +125,4 @@ cocos2d::Vec4 Device::getSafeAreaEdge() NS_CC_END -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#endif // CC_PLATFORM == CC_PLATFORM_MAC_OSX diff --git a/native/cocos/platform/mac/CCGL-mac.h b/native/cocos/platform/mac/CCGL-mac.h index 970f49fb0b..27ae6f82f8 100644 --- a/native/cocos/platform/mac/CCGL-mac.h +++ b/native/cocos/platform/mac/CCGL-mac.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __PLATFORM_MAC_CCGL_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX #import #import @@ -53,4 +53,4 @@ THE SOFTWARE. #endif // __PLATFORM_MAC_CCGL_H__ -#endif //s CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#endif //s CC_PLATFORM == CC_PLATFORM_MAC_OSX diff --git a/native/cocos/platform/mac/CCPlatformDefine-mac.h b/native/cocos/platform/mac/CCPlatformDefine-mac.h index 805aecd7be..7561727668 100644 --- a/native/cocos/platform/mac/CCPlatformDefine-mac.h +++ b/native/cocos/platform/mac/CCPlatformDefine-mac.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCPLATFORMDEFINE_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX #include @@ -55,7 +55,7 @@ THE SOFTWARE. #endif #endif -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#endif // CC_PLATFORM == CC_PLATFORM_MAC_OSX #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/native/cocos/platform/win32/CCDevice-win32.cpp b/native/cocos/platform/win32/CCDevice-win32.cpp index 458c699691..acc0a40c44 100644 --- a/native/cocos/platform/win32/CCDevice-win32.cpp +++ b/native/cocos/platform/win32/CCDevice-win32.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "platform/CCDevice.h" #include "platform/CCFileUtils.h" @@ -98,4 +98,4 @@ cocos2d::Vec4 Device::getSafeAreaEdge() NS_CC_END -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/platform/win32/CCFileUtils-win32.cpp b/native/cocos/platform/win32/CCFileUtils-win32.cpp index bddb2de85c..080514e91b 100644 --- a/native/cocos/platform/win32/CCFileUtils-win32.cpp +++ b/native/cocos/platform/win32/CCFileUtils-win32.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "platform/win32/CCFileUtils-win32.h" #include "platform/win32/CCUtils-win32.h" @@ -426,4 +426,4 @@ bool FileUtilsWin32::removeDirectory(const std::string& dirPath) NS_CC_END -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/platform/win32/CCFileUtils-win32.h b/native/cocos/platform/win32/CCFileUtils-win32.h index a625d4421e..a2c637adbf 100644 --- a/native/cocos/platform/win32/CCFileUtils-win32.h +++ b/native/cocos/platform/win32/CCFileUtils-win32.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CC_FILEUTILS_WIN32_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "platform/CCFileUtils.h" #include "base/ccMacros.h" @@ -139,6 +139,6 @@ protected: NS_CC_END -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // CC_PLATFORM == CC_PLATFORM_WINDOWS #endif // __CC_FILEUTILS_WIN32_H__ diff --git a/native/cocos/platform/win32/CCGL-win32.h b/native/cocos/platform/win32/CCGL-win32.h index 23dcdfa780..3825ccf6b4 100644 --- a/native/cocos/platform/win32/CCGL-win32.h +++ b/native/cocos/platform/win32/CCGL-win32.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCGL_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "gles/glew.h" @@ -41,6 +41,6 @@ THE SOFTWARE. #define GL_HALF_FLOAT_OES 0x8D61 #define GL_UNSIGNED_INT_24_8_OES 0x84FA -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // CC_PLATFORM == CC_PLATFORM_WINDOWS #endif // __CCGL_H__ diff --git a/native/cocos/platform/win32/CCPlatformDefine-win32.h b/native/cocos/platform/win32/CCPlatformDefine-win32.h index b918a0edd5..845d89b6b5 100644 --- a/native/cocos/platform/win32/CCPlatformDefine-win32.h +++ b/native/cocos/platform/win32/CCPlatformDefine-win32.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CCPLATFORMDEFINE_H__ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #ifdef __MINGW32__ #include @@ -73,7 +73,7 @@ THE SOFTWARE. #pragma comment(lib,"glfw3.lib") #endif -#endif //s CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif //s CC_PLATFORM == CC_PLATFORM_WINDOWS #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/native/cocos/platform/win32/CCStdC-win32.cpp b/native/cocos/platform/win32/CCStdC-win32.cpp index b471cfec72..8897d55a5f 100644 --- a/native/cocos/platform/win32/CCStdC-win32.cpp +++ b/native/cocos/platform/win32/CCStdC-win32.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #include "platform/CCStdC.h" @@ -51,5 +51,5 @@ NS_CC_END #endif // __MINGW32__ -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // CC_PLATFORM == CC_PLATFORM_WINDOWS diff --git a/native/cocos/platform/win32/compat/stdint.h b/native/cocos/platform/win32/compat/stdint.h index 14276eba8b..80111b1868 100644 --- a/native/cocos/platform/win32/compat/stdint.h +++ b/native/cocos/platform/win32/compat/stdint.h @@ -33,7 +33,7 @@ #define _MSC_STDINT_H_ #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#if CC_PLATFORM == CC_PLATFORM_WINDOWS #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" @@ -246,6 +246,6 @@ typedef uint64_t uintmax_t; #endif // __STDC_CONSTANT_MACROS ] -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 +#endif // CC_PLATFORM == CC_PLATFORM_WINDOWS #endif // _MSC_STDINT_H_ ] diff --git a/native/cocos/renderer/Macro.h b/native/cocos/renderer/Macro.h deleted file mode 100644 index 93315d49e0..0000000000 --- a/native/cocos/renderer/Macro.h +++ /dev/null @@ -1,192 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "platform/CCPlatformConfig.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#include -#endif - -#ifndef RENDERER_BEGIN -#define RENDERER_BEGIN namespace cocos2d { namespace renderer { -#endif // RENDERER_BEGIN - -#ifndef RENDERER_END -#define RENDERER_END }} -#endif // RENDERER_END - -//#ifndef DISALLOW_COPY_ASSIGN_AND_MOVE - #define CC_DISALLOW_COPY_ASSIGN_AND_MOVE(type) \ - type(const type&) = delete; \ - type& operator =(const type&) = delete; \ - type(type &&) = delete; \ - type& operator =(const type &&) = delete; -//#endif // DISALLOW_COPY_ASSIGN_AND_MOVE - -#define RENDERER_LOG_TAG "renderer" -#define RENDERER_QUOTEME_(x) #x -#define RENDERER_QUOTEME(x) RENDERER_QUOTEME_(x) - -#if defined(COCOS2D_DEBUG) && COCOS2D_DEBUG > 0 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#define RENDERER_LOGV(fmt, ...) __android_log_print(ANDROID_LOG_VERBOSE, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#else -#define RENDERER_LOGV(fmt, ...) printf("V/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#else -#define RENDERER_LOGV(fmt, ...) do {} while(false) -#endif // defined(COCOS2D_DEBUG) && COCOS2D_DEBUG > 0 - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#define RENDERER_LOGD(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGI(fmt, ...) __android_log_print(ANDROID_LOG_INFO, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGW(fmt, ...) __android_log_print(ANDROID_LOG_WARN, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGE(fmt, ...) __android_log_print(ANDROID_LOG_ERROR, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#else -#define RENDERER_LOGD(fmt, ...) printf("D/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGI(fmt, ...) printf("I/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGW(fmt, ...) printf("W/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGE(fmt, ...) printf("E/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - - -#define RENDERER_DEBUG 1 // REFINE: remove this - -#define RENDERER_SAFE_RELEASE(p) do { if((p) != nullptr) (p)->release(); } while(false) -#define RENDERER_SAFE_RETAIN(p) do { if((p) != nullptr) (p)->retain(); } while(false) - -#define RENDERER_DEFINE_CREATE_METHOD_0(clsName, initMethod) \ -static clsName* create() \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod()) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_1(clsName, initMethod, arg0Type) \ -static clsName* create(arg0Type arg0) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_2(clsName, initMethod, arg0Type, arg1Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_3(clsName, initMethod, arg0Type, arg1Type, arg2Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1, arg2Type arg2) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1, arg2)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_4(clsName, initMethod, arg0Type, arg1Type, arg2Type, arg3Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1, arg2Type arg2, arg3Type arg3) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1, arg2, arg3)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_5(clsName, initMethod, arg0Type, arg1Type, arg2Type, arg3Type, arg4Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1, arg2Type arg2, arg3Type arg3, arg4Type arg4) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1, arg2, arg3, arg4)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_6(clsName, initMethod, arg0Type, arg1Type, arg2Type, arg3Type, arg4Type, arg5Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1, arg2Type arg2, arg3Type arg3, arg4Type arg4, arg5Type arg5) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1, arg2, arg3, arg4, arg5)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -// enum class to GLENUM -#define ENUM_CLASS_TO_GLENUM(value) static_cast(value) - -#define _GL_CHECK(_call) \ - do { \ - _call; \ - GLenum gl_err = glGetError(); \ - if (0 != gl_err) \ - RENDERER_LOGE(#_call "; GL error 0x%x: %s:%s", gl_err, glEnumName(gl_err), __FUNCTION__); \ - } while(false) - - -#if COCOS2D_DEBUG > 0 -# define GL_CHECK(_call) _GL_CHECK(_call) -#else -# define GL_CHECK(_call) _call -#endif // BRENDERER_CONFIG_DEBUG - -#ifndef RENDERER_PI -#define RENDERER_PI 3.1415926535897932385f -#endif // RENDERER_PI diff --git a/native/cocos/renderer/core/CoreDef.h b/native/cocos/renderer/core/CoreDef.h index 4e94f0d62c..a1fcacf21c 100755 --- a/native/cocos/renderer/core/CoreDef.h +++ b/native/cocos/renderer/core/CoreDef.h @@ -8,14 +8,6 @@ #define CC_COMPILER_CLANG 2 #define CC_COMPILER_GNUC 3 -// Initial platform stuff to set. -#define CC_PLATFORM_WINDOWS 1 -#define CC_PLATFORM_LINUX 2 -#define CC_PLATFORM_MAC_OSX 3 -#define CC_PLATFORM_MAC_IOS 4 -#define CC_PLATFORM_ANDROID 5 -#define CC_PLATFORM_NACL 6 - // CPU Architecture #define CC_CPU_UNKNOWN 0 #define CC_CPU_X86 1 @@ -80,35 +72,14 @@ # error "Unknown compiler. Abort!" #endif -// Platform recognition -#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(_WIN64) || defined(__WIN64__) || defined(WIN64) -# define CC_PLATFORM CC_PLATFORM_WINDOWS -#elif defined(__APPLE_CC__) -// Device Simulator -// Both requiring OS version 4.0 or greater -# if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 -# define CC_PLATFORM CC_PLATFORM_MAC_IOS -# else -# define CC_PLATFORM CC_PLATFORM_MAC_OSX -# endif -#elif defined(__ANDROID__) -# define CC_PLATFORM CC_PLATFORM_ANDROID -#elif defined(linux) || defined(__linux) || defined(__linux__) -# define CC_PLATFORM CC_PLATFORM_LINUX -#elif defined(__native_client__) -# define CC_PLATFORM CC_PLATFORM_NACL -#else -# error "Couldn't recognize platform" -#endif - #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) # define CC_ENDIAN CC_ENDIAN_LITTLE #else -# if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) +# if (CC_PLATFORM == CC_PLATFORM_MAC_OSX_OSX) # include # else # include -# endif // (CC_PLATFORM == CC_PLATFORM_MAC_OSX) +# endif // (CC_PLATFORM == CC_PLATFORM_MAC_OSX_OSX) # # if __BYTE_ORDER == __LITTLE_ENDIAN # define CC_ENDIAN CC_ENDIAN_LITTLE @@ -120,9 +91,9 @@ // CPU architecture type recognition #if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) ||(defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) # define CC_CPU CC_CPU_X86 -#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX && CC_ENDIAN == CC_ENDIAN_BIG +#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX_OSX && CC_ENDIAN == CC_ENDIAN_BIG # define CC_CPU CC_CPU_PPC -#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX +#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX_OSX # define COCOS_CPU CC_CPU_X86 #elif CC_PLATFORM == CC_PLATFORM_MAC_IOS && (defined(__i386__) || defined(__x86_64__)) # define CC_CPU CC_CPU_X86 @@ -330,9 +301,6 @@ Note: #define CC_STL_MEMORY_ALLOCATOR CC_STL_MEMORY_ALLOCATOR_CUSTOM #endif -// Namespace define -#define CC_USING_NAMESPACE using namespace cocos2d; - #define CC_TOSTR(s) #s #if (CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/renderer/gfx-metal/MTLTexture.mm b/native/cocos/renderer/gfx-metal/MTLTexture.mm index 3f86d51e25..7a777b4eb8 100644 --- a/native/cocos/renderer/gfx-metal/MTLTexture.mm +++ b/native/cocos/renderer/gfx-metal/MTLTexture.mm @@ -77,7 +77,7 @@ bool CCMTLTexture::Initialize(const GFXTextureInfo& info) descriptor.mipmapLevelCount = mip_level_; descriptor.arrayLength = array_layer_; -#if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) +#if (CC_PLATFORM == CC_PLATFORM_MAC_OSX_OSX) //FIXME: is it correct here for performace optimization? // Should change to MTLStorageModeManaged if texture usage is GFXTextureFlags::BAKUP_BUFFER? if (usage_ == GFXTextureUsage::COLOR_ATTACHMENT || diff --git a/native/cocos/renderer/soa-mgr/core/CoreDef.h b/native/cocos/renderer/soa-mgr/core/CoreDef.h index 9dfe0adbdc..79a82cadec 100644 --- a/native/cocos/renderer/soa-mgr/core/CoreDef.h +++ b/native/cocos/renderer/soa-mgr/core/CoreDef.h @@ -12,7 +12,7 @@ // Initial platform stuff to set. #define CC_PLATFORM_WINDOWS 1 #define CC_PLATFORM_LINUX 2 -#define CC_PLATFORM_MAC_OSX 3 +#define CC_PLATFORM_MAC_OSX_OSX 3 #define CC_PLATFORM_MAC_IOS 4 #define CC_PLATFORM_ANDROID 5 #define CC_PLATFORM_NACL 6 @@ -118,7 +118,7 @@ # define CC_PLATFORM CC_PLATFORM_MAC_IOS # else //# warning " Mac os" -# define CC_PLATFORM CC_PLATFORM_MAC_OSX +# define CC_PLATFORM CC_PLATFORM_MAC_OSX_OSX # endif #elif defined(__ANDROID__) # define CC_PLATFORM CC_PLATFORM_ANDROID @@ -128,7 +128,7 @@ # define CC_PLATFORM CC_PLATFORM_NACL #else //# error "Couldn't recognize platform" -# define CC_PLATFORM CC_PLATFORM_MAC_OSX +# define CC_PLATFORM CC_PLATFORM_MAC_OSX_OSX #endif // Endian Settings @@ -150,9 +150,9 @@ // CPU architecture type recognition #if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) ||(defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) # define CC_CPU CC_CPU_X86 -#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX && CC_ENDIAN == CC_ENDIAN_BIG +#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX_OSX && CC_ENDIAN == CC_ENDIAN_BIG # define CC_CPU CC_CPU_PPC -#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX +#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX_OSX # define CC_CPU CC_CPU_X86 //# warning "CC_cPU x86" #elif CC_PLATFORM == CC_PLATFORM_MAC_IOS && (defined(__i386__) || defined(__x86_64__)) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp index 9a002c5a79..15ba577a29 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp" -#if (USE_AUDIO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (USE_AUDIO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "scripting/js-bindings/manual/jsb_conversions.hpp" #include "scripting/js-bindings/manual/jsb_global.h" #include "audio/include/AudioEngine.h" @@ -831,4 +831,4 @@ bool register_all_audioengine(se::Object* obj) return true; } -#endif //#if (USE_AUDIO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif //#if (USE_AUDIO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp index be7729a72b..f8d356edc9 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp @@ -1,6 +1,6 @@ #pragma once #include "base/ccConfig.h" -#if (USE_AUDIO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (USE_AUDIO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" @@ -46,4 +46,4 @@ SE_DECLARE_FUNC(js_audioengine_AudioEngine_setFinishCallback); SE_DECLARE_FUNC(js_audioengine_AudioEngine_getProfile); SE_DECLARE_FUNC(js_audioengine_AudioEngine_getPlayingAudioCount); -#endif //#if (USE_AUDIO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif //#if (USE_AUDIO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_network_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_network_auto.cpp index 8a7309b43d..764430ad3f 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_network_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_network_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/js-bindings/auto/jsb_cocos2dx_network_auto.hpp" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "scripting/js-bindings/manual/jsb_conversions.hpp" #include "scripting/js-bindings/manual/jsb_global.h" #include "network/CCDownloader.h" @@ -145,4 +145,4 @@ bool register_all_network(se::Object* obj) return true; } -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif //#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_network_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_network_auto.hpp index b05d6ccf13..c150f2689b 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_network_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_network_auto.hpp @@ -1,6 +1,6 @@ #pragma once #include "base/ccConfig.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" @@ -12,4 +12,4 @@ bool register_all_network(se::Object* obj); SE_DECLARE_FUNC(js_network_Downloader_setOnTaskProgress); SE_DECLARE_FUNC(js_network_Downloader_Downloader); -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif //#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.cpp index 41b254737c..6f175f36f9 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/js-bindings/auto/jsb_gfx_auto.hpp" -#if (USE_GFX_RENDERER > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (USE_GFX_RENDERER > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "scripting/js-bindings/manual/jsb_conversions.hpp" #include "scripting/js-bindings/manual/jsb_global.h" #include "renderer/gfx-gles2/GFXGLES2.h" @@ -4568,4 +4568,4 @@ bool register_all_gfx(se::Object* obj) return true; } -#endif //#if (USE_GFX_RENDERER > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif //#if (USE_GFX_RENDERER > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp index 03886c81d1..ad7f786df8 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp @@ -1,6 +1,6 @@ #pragma once #include "base/ccConfig.h" -#if (USE_GFX_RENDERER > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (USE_GFX_RENDERER > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" @@ -302,4 +302,4 @@ SE_DECLARE_FUNC(js_gfx_GLES2Device_CreateGFXInputAssembler); SE_DECLARE_FUNC(js_gfx_GLES2Device_CreateGFXFramebuffer); SE_DECLARE_FUNC(js_gfx_GLES2Device_GLES2Device); -#endif //#if (USE_GFX_RENDERER > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif //#if (USE_GFX_RENDERER > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_video_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_video_auto.cpp index 676955f6b8..4b4bf6af21 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_video_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_video_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/js-bindings/auto/jsb_video_auto.hpp" -#if (USE_VIDEO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (USE_VIDEO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) #include "scripting/js-bindings/manual/jsb_conversions.hpp" #include "scripting/js-bindings/manual/jsb_global.h" #include "ui/videoplayer/VideoPlayer.h" @@ -365,4 +365,4 @@ bool register_all_video(se::Object* obj) return true; } -#endif //#if (USE_VIDEO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#endif //#if (USE_VIDEO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_video_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_video_auto.hpp index 40e7df83c7..ffbcbe1e02 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_video_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_video_auto.hpp @@ -1,6 +1,6 @@ #pragma once #include "base/ccConfig.h" -#if (USE_VIDEO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (USE_VIDEO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" @@ -25,4 +25,4 @@ SE_DECLARE_FUNC(js_video_VideoPlayer_setVisible); SE_DECLARE_FUNC(js_video_VideoPlayer_seekTo); SE_DECLARE_FUNC(js_video_VideoPlayer_VideoPlayer); -#endif //#if (USE_VIDEO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#endif //#if (USE_VIDEO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_webview_auto.cpp b/native/cocos/scripting/js-bindings/auto/jsb_webview_auto.cpp index 5e6ca78de3..e843c77c37 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_webview_auto.cpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_webview_auto.cpp @@ -1,5 +1,5 @@ #include "scripting/js-bindings/auto/jsb_webview_auto.hpp" -#if (USE_WEB_VIEW > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (USE_WEB_VIEW > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) #include "scripting/js-bindings/manual/jsb_conversions.hpp" #include "scripting/js-bindings/manual/jsb_global.h" #include "ui/webview/WebView.h" @@ -709,4 +709,4 @@ bool register_all_webview(se::Object* obj) return true; } -#endif //#if (USE_WEB_VIEW > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#endif //#if (USE_WEB_VIEW > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) diff --git a/native/cocos/scripting/js-bindings/auto/jsb_webview_auto.hpp b/native/cocos/scripting/js-bindings/auto/jsb_webview_auto.hpp index 1bd3c1f04a..331b8687e3 100644 --- a/native/cocos/scripting/js-bindings/auto/jsb_webview_auto.hpp +++ b/native/cocos/scripting/js-bindings/auto/jsb_webview_auto.hpp @@ -1,6 +1,6 @@ #pragma once #include "base/ccConfig.h" -#if (USE_WEB_VIEW > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (USE_WEB_VIEW > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" @@ -37,4 +37,4 @@ SE_DECLARE_FUNC(js_webview_WebView_getOnDidFinishLoading); SE_DECLARE_FUNC(js_webview_WebView_create); SE_DECLARE_FUNC(js_webview_WebView_WebView); -#endif //#if (USE_WEB_VIEW > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#endif //#if (USE_WEB_VIEW > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) diff --git a/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp b/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp index 16cd6c9f9b..a038f44767 100644 --- a/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp +++ b/native/cocos/scripting/js-bindings/jswrapper/v8/ScriptEngine.cpp @@ -373,7 +373,7 @@ namespace se { } _beforeInitHookArray.clear(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) std::string flags("--jitless"); v8::V8::SetFlagsFromString(flags.c_str(), (int)flags.length()); #endif diff --git a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_network_manual.cpp b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_network_manual.cpp index cff08436e6..8db394dced 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_network_manual.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_cocos2dx_network_manual.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "base/ccConfig.h" #include "jsb_cocos2dx_network_manual.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "scripting/js-bindings/manual/jsb_conversions.hpp" #include "scripting/js-bindings/manual/jsb_global.h" #include "network/CCDownloader.h" @@ -190,4 +190,4 @@ bool register_all_cocos2dx_network_manual(se::Object *obj) { _SE(js_network_Downloader_setOnFileTaskSuccess)); return true; } -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif //#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp index 8a1e9e4b51..1a376790e5 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp @@ -33,7 +33,7 @@ #include "platform/CCApplication.h" //#include "ui/edit-box/EditBox.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #include "platform/android/jni/JniImp.h" #endif @@ -359,8 +359,8 @@ namespace { // fclose(fp); std::string reletivePath = fullPath; -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_IOS - #if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_MAC_IOS + #if CC_PLATFORM == CC_PLATFORM_MAC_OSX const std::string reletivePathKey = "/Contents/Resources"; #else const std::string reletivePathKey = ".app"; @@ -504,15 +504,15 @@ static bool JSBCore_os(se::State& s) se::Value os; // osx, ios, android, windows, linux, etc.. -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) os.setString("iOS"); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) os.setString("Android"); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#elif (CC_PLATFORM == CC_PLATFORM_WINDOWS) os.setString("Windows"); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) +#elif (CC_PLATFORM == CC_PLATFORM_LINUX) os.setString("Linux"); -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#elif (CC_PLATFORM == CC_PLATFORM_MAC_OSX) os.setString("macOS"); os.setString("Unknown"); #endif @@ -995,7 +995,7 @@ SE_BIND_FUNC(js_saveImageData) // SE_PRECONDITION2(ok, false, "Convert arg1 text failed!"); // // -//#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +//#if CC_PLATFORM == CC_PLATFORM_ANDROID // setGameInfoDebugViewTextJNI(index, text); //#endif // return true; @@ -1008,7 +1008,7 @@ SE_BIND_FUNC(js_saveImageData) //static bool js_openDebugView(se::State& s) //{ -//#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +//#if CC_PLATFORM == CC_PLATFORM_ANDROID // openDebugViewJNI(); //#endif // return true; diff --git a/native/cocos/scripting/js-bindings/manual/jsb_module_register.cpp b/native/cocos/scripting/js-bindings/manual/jsb_module_register.cpp index aef27187b0..bad77d6e74 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_module_register.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_module_register.cpp @@ -51,15 +51,15 @@ #include "cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.hpp" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX) #include "cocos/scripting/js-bindings/manual/JavaScriptObjCBridge.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include "cocos/scripting/js-bindings/manual/JavaScriptJavaBridge.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_ANDROID) #if USE_VIDEO #include "cocos/scripting/js-bindings/auto/jsb_video_auto.hpp" @@ -69,7 +69,7 @@ #include "cocos/scripting/js-bindings/auto/jsb_webview_auto.hpp" #endif -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#endif // (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_ANDROID) using namespace cocos2d; @@ -99,11 +99,11 @@ bool jsb_register_all_modules() // extension depend on network se->addRegisterCallback(register_all_extension); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX) se->addRegisterCallback(register_javascript_objc_bridge); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) se->addRegisterCallback(register_javascript_java_bridge); #endif @@ -116,7 +116,7 @@ bool jsb_register_all_modules() se->addRegisterCallback(register_all_socketio); #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_ANDROID) #if USE_VIDEO // se->addRegisterCallback(register_all_video); @@ -126,7 +126,7 @@ bool jsb_register_all_modules() // se->addRegisterCallback(register_all_webview); #endif -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#endif // (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_ANDROID) se->addAfterCleanupHook([](){ PoolManager::getInstance()->getCurrentPool()->clear(); diff --git a/native/cocos/scripting/js-bindings/manual/jsb_platfrom_apple.mm b/native/cocos/scripting/js-bindings/manual/jsb_platfrom_apple.mm index d3e1205223..a481d47f15 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_platfrom_apple.mm +++ b/native/cocos/scripting/js-bindings/manual/jsb_platfrom_apple.mm @@ -47,7 +47,7 @@ static std::vector getAvailableFontFamilyNames() { std::vector ret; -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if CC_PLATFORM == CC_PLATFORM_MAC_OSX CFArrayRef allFamilyNames = CTFontManagerCopyAvailableFontFamilyNames(); #else CFArrayRef allFamilyNames = (CFArrayRef) [[UIFont familyNames] retain]; diff --git a/native/cocos/scripting/js-bindings/manual/jsb_websocket.cpp b/native/cocos/scripting/js-bindings/manual/jsb_websocket.cpp index 8e4bed7497..805fddaf4d 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_websocket.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_websocket.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "base/ccConfig.h" #include "jsb_websocket.hpp" -#if (USE_SOCKET > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (USE_SOCKET > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) #include "cocos/scripting/js-bindings/jswrapper/SeApi.h" #include "cocos/scripting/js-bindings/manual/jsb_conversions.hpp" #include "cocos/scripting/js-bindings/manual/jsb_global.h" @@ -580,4 +580,4 @@ bool register_all_websocket(se::Object* obj) return true; } -#endif //#if (USE_SOCKET > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif //#if (USE_SOCKET > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/scripting/js-bindings/manual/jsb_xmlhttprequest.cpp b/native/cocos/scripting/js-bindings/manual/jsb_xmlhttprequest.cpp index f5db95b93c..46584521b2 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_xmlhttprequest.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_xmlhttprequest.cpp @@ -32,7 +32,7 @@ // #include "base/ccConfig.h" #include "jsb_xmlhttprequest.hpp" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) #include #include #include @@ -1148,4 +1148,4 @@ bool register_all_xmlhttprequest(se::Object* global) return true; } -#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#endif //#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) diff --git a/native/cocos/storage/local-storage/LocalStorage-android.cpp b/native/cocos/storage/local-storage/LocalStorage-android.cpp index 16843ab864..df2f441872 100644 --- a/native/cocos/storage/local-storage/LocalStorage-android.cpp +++ b/native/cocos/storage/local-storage/LocalStorage-android.cpp @@ -33,7 +33,7 @@ #include "storage/local-storage/LocalStorage.h" #include "base/ccMacros.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include #include @@ -148,4 +148,4 @@ void localStorageGetLength( int& outLength ) outLength = JniHelper::callStaticIntMethod(JCLS_LOCALSTORAGE,"getLength"); } -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#endif // #if (CC_PLATFORM == CC_PLATFORM_ANDROID) diff --git a/native/cocos/storage/local-storage/LocalStorage.cpp b/native/cocos/storage/local-storage/LocalStorage.cpp index a9060e64a2..cf6e9c7d61 100644 --- a/native/cocos/storage/local-storage/LocalStorage.cpp +++ b/native/cocos/storage/local-storage/LocalStorage.cpp @@ -32,12 +32,12 @@ #include "storage/local-storage/LocalStorage.h" #include "base/ccMacros.h" -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +#if (CC_PLATFORM != CC_PLATFORM_ANDROID) #include #include #include -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #include #else #include @@ -249,4 +249,4 @@ void localStorageGetLength( int& outLength ) } } -#endif // #if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) +#endif // #if (CC_PLATFORM != CC_PLATFORM_ANDROID) diff --git a/native/cocos/ui/videoplayer/VideoPlayer-android.cpp b/native/cocos/ui/videoplayer/VideoPlayer-android.cpp index 6b3a1a3f9f..91e85ef971 100644 --- a/native/cocos/ui/videoplayer/VideoPlayer-android.cpp +++ b/native/cocos/ui/videoplayer/VideoPlayer-android.cpp @@ -24,7 +24,7 @@ #include "VideoPlayer.h" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) #include #include #include diff --git a/native/cocos/ui/videoplayer/VideoPlayer-ios.mm b/native/cocos/ui/videoplayer/VideoPlayer-ios.mm index 8369f15e41..47cd28a565 100644 --- a/native/cocos/ui/videoplayer/VideoPlayer-ios.mm +++ b/native/cocos/ui/videoplayer/VideoPlayer-ios.mm @@ -27,7 +27,7 @@ USING_NS_CC; // No Available on tvOS -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS && !defined(CC_TARGET_OS_TVOS) +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS && !defined(CC_TARGET_OS_TVOS) //------------------------------------------------------------------------------------- diff --git a/native/cocos/ui/webview/WebView-inl.h b/native/cocos/ui/webview/WebView-inl.h index fd764c6668..49818eefbd 100644 --- a/native/cocos/ui/webview/WebView-inl.h +++ b/native/cocos/ui/webview/WebView-inl.h @@ -27,9 +27,9 @@ #include "platform/CCFileUtils.h" #include "platform/CCPlatformConfig.h" -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS && !defined(CC_PLATFORM_OS_TVOS) +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS && !defined(CC_PLATFORM_OS_TVOS) #include "WebViewImpl-ios.h" -#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#elif CC_PLATFORM == CC_PLATFORM_ANDROID #include "WebViewImpl-android.h" #else static_assert(false, "WebView only supported on iOS & Android"); diff --git a/native/cocos/ui/webview/WebViewImpl-ios.mm b/native/cocos/ui/webview/WebViewImpl-ios.mm index c77ef358df..850e023127 100644 --- a/native/cocos/ui/webview/WebViewImpl-ios.mm +++ b/native/cocos/ui/webview/WebViewImpl-ios.mm @@ -26,7 +26,7 @@ #include "platform/CCPlatformConfig.h" // Webview not available on tvOS -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) #import #import @@ -391,4 +391,4 @@ namespace cocos2d { } } //namespace cocos2d -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS +#endif // CC_PLATFORM == CC_PLATFORM_MAC_IOS diff --git a/native/templates/js-template-android-instant/frameworks/runtime-src/Classes/AppDelegate.cpp b/native/templates/js-template-android-instant/frameworks/runtime-src/Classes/AppDelegate.cpp index 29b443ff08..324e12c579 100755 --- a/native/templates/js-template-android-instant/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/native/templates/js-template-android-instant/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -34,7 +34,7 @@ #include "cocos/scripting/js-bindings/event/CustomEventTypes.h" #include "cocos/scripting/js-bindings/manual/jsb_classtype.hpp" -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && PACKAGE_AS +#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && PACKAGE_AS #include "SDKManager.h" #include "jsb_anysdk_protocols_auto.hpp" #include "manualanysdkbindings.hpp" @@ -49,14 +49,14 @@ AppDelegate::AppDelegate(int width, int height) : Application("Cocos Game", widt AppDelegate::~AppDelegate() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && PACKAGE_AS +#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && PACKAGE_AS SDKManager::getInstance()->purge(); #endif } bool AppDelegate::applicationDidFinishLaunching() { -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS && PACKAGE_AS +#if CC_PLATFORM == CC_PLATFORM_MAC_IOS && PACKAGE_AS SDKManager::getInstance()->loadAllPlugins(); #endif @@ -77,7 +77,7 @@ bool AppDelegate::applicationDidFinishLaunching() jsb_register_all_modules(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && PACKAGE_AS +#if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && PACKAGE_AS se->addRegisterCallback(register_all_anysdk_framework); se->addRegisterCallback(register_all_anysdk_manual); #endif diff --git a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp index d93038e8f8..8e7e5587a7 100755 --- a/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp +++ b/native/tools/simulator/frameworks/runtime-src/Classes/ide-support/RuntimeJsImpl.cpp @@ -91,7 +91,7 @@ static bool runtime_FileUtils_addSearchPath(se::State& s) cobj->addSearchPath(arg0, arg1); } -#if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if(CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) // add project path to search path cobj->addSearchPath(RuntimeEngine::getInstance()->getRuntime()->getProjectPath() + arg0, arg1); #endif @@ -127,7 +127,7 @@ static bool runtime_FileUtils_setSearchPaths(se::State& s) } } -#if(CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if(CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) vecPaths.insert(vecPaths.end(), projPath.begin(), projPath.end()); #endif if (FileServer::getShareInstance()->getIsUsingWritePath()) diff --git a/native/tools/simulator/libsimulator/lib/network/CCHTTPRequest.cpp b/native/tools/simulator/libsimulator/lib/network/CCHTTPRequest.cpp index f9cd829c09..17daa601c3 100755 --- a/native/tools/simulator/libsimulator/lib/network/CCHTTPRequest.cpp +++ b/native/tools/simulator/libsimulator/lib/network/CCHTTPRequest.cpp @@ -221,7 +221,7 @@ bool HTTPRequest::start(void) #ifdef _WINDOWS_ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#if (CC_PLATFORM == CC_PLATFORM_WP8) || (CC_PLATFORM == CC_PLATFORM_WINRT) std::thread worker(requestCURL, this); worker.detach(); @@ -232,7 +232,7 @@ bool HTTPRequest::start(void) this, // argument to thread function 0, // use default creation flags NULL); -#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WP8 +#endif // CC_PLATFORM == CC_PLATFORM_WP8 #else pthread_create(&_thread, NULL, requestCURL, this); diff --git a/native/tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp b/native/tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp index d418d37906..42c5f017a6 100755 --- a/native/tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp +++ b/native/tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp @@ -51,7 +51,7 @@ void ConfigParser::readConfig(const string &filepath) { string fullPathFile = filepath; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_ANDROID) // add writable path to search path temporarily for reading config file vector searchPathArray = cocos2d::FileUtils::getInstance()->getSearchPaths(); searchPathArray.insert(searchPathArray.begin(), FileServer::getShareInstance()->getWritePath()); @@ -65,7 +65,7 @@ void ConfigParser::readConfig(const string &filepath) } string fileContent = cocos2d::FileUtils::getInstance()->getStringFromFile(fullPathFile); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_ANDROID) // revert search path searchPathArray.erase(searchPathArray.begin()); cocos2d::FileUtils::getInstance()->setSearchPaths(searchPathArray); diff --git a/native/tools/simulator/libsimulator/lib/runtime/ConnectWaitLayer.cpp b/native/tools/simulator/libsimulator/lib/runtime/ConnectWaitLayer.cpp index 96bb1379e8..5df0fa461b 100755 --- a/native/tools/simulator/libsimulator/lib/runtime/ConnectWaitLayer.cpp +++ b/native/tools/simulator/libsimulator/lib/runtime/ConnectWaitLayer.cpp @@ -96,7 +96,7 @@ ConnectWaitLayer::ConnectWaitLayer() addChild(IPlabel, 9001); std::string transferTip = "waiting for file transfer ..."; - if (CC_PLATFORM_WIN32 == CC_TARGET_PLATFORM || CC_PLATFORM_MAC == CC_TARGET_PLATFORM) + if (CC_PLATFORM_WINDOWS == CC_PLATFORM || CC_PLATFORM_MAC_OSX == CC_PLATFORM) { transferTip = "waiting for debugger to connect ..."; } diff --git a/native/tools/simulator/libsimulator/lib/runtime/ConsoleCommand.cpp b/native/tools/simulator/libsimulator/lib/runtime/ConsoleCommand.cpp index 622f32607d..7d4c500352 100755 --- a/native/tools/simulator/libsimulator/lib/runtime/ConsoleCommand.cpp +++ b/native/tools/simulator/libsimulator/lib/runtime/ConsoleCommand.cpp @@ -211,7 +211,7 @@ void ConsoleCommand::onSendCommand(int fd, const std::string &args) dReplyParse.AddMember("code",0,allocator); } else if(strcmp(strcmd.c_str(), "shutdownapp") == 0) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) #include auto glview = dynamic_cast (Director::getInstance()->getOpenGLView()); HWND hWnd = glview->getWin32Window(); @@ -222,13 +222,13 @@ void ConsoleCommand::onSendCommand(int fd, const std::string &args) } else if(strcmp(strcmd.c_str(), "getplatform") == 0) { string platform="UNKNOW"; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) platform = "WIN32"; -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#elif (CC_PLATFORM == CC_PLATFORM_MAC_OSX) platform = "MAC"; -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#elif (CC_PLATFORM == CC_PLATFORM_MAC_IOS) platform = "IOS"; -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) platform = "ANDROID"; #endif rapidjson::Value bodyvalue(rapidjson::kObjectType); @@ -239,7 +239,7 @@ void ConsoleCommand::onSendCommand(int fd, const std::string &args) dReplyParse.AddMember("code", 0, allocator); } else if(strcmp(strcmd.c_str(), "usewritablepath") == 0) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_ANDROID) // only iOS and Android need to open using write path by Code IDE FileServer::getShareInstance()->setIsUsingWritePath(true); diff --git a/native/tools/simulator/libsimulator/lib/runtime/FileServer.cpp b/native/tools/simulator/libsimulator/lib/runtime/FileServer.cpp index 5d3849ec11..a277c1f1ff 100755 --- a/native/tools/simulator/libsimulator/lib/runtime/FileServer.cpp +++ b/native/tools/simulator/libsimulator/lib/runtime/FileServer.cpp @@ -36,7 +36,7 @@ THE SOFTWARE. #include #endif -#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if CC_PLATFORM == CC_PLATFORM_ANDROID #ifndef bzero #define bzero(a, b) memset(a, 0, b); #endif @@ -143,7 +143,7 @@ bool FileServer::listenOnTCP(int port) hints.ai_family = AF_INET; // AF_UNSPEC: Do we need IPv6 ? hints.ai_socktype = SOCK_STREAM; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) WSADATA wsaData; n = WSAStartup(MAKEWORD(2, 2),&wsaData); #endif @@ -183,7 +183,7 @@ bool FileServer::listenOnTCP(int port) break; /* success */ /* bind error, close and try next one */ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) closesocket(listenfd); #else close(listenfd); @@ -255,7 +255,7 @@ _writeEndThread(false), _responseRunning(false), _responseEndThread(false) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_ANDROID) // need to be opened by Code IDE _isUsingWritePath = false; #else @@ -264,7 +264,7 @@ _responseEndThread(false) _writePath = cocos2d::FileUtils::getInstance()->getWritablePath(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (CC_PLATFORM == CC_PLATFORM_MAC_OSX) #include "Widget_mac.h" _writePath += getCurAppName(); _writePath += "/"; diff --git a/native/tools/simulator/libsimulator/lib/runtime/Runtime.cpp b/native/tools/simulator/libsimulator/lib/runtime/Runtime.cpp index 367efbacf9..d5281b8fff 100755 --- a/native/tools/simulator/libsimulator/lib/runtime/Runtime.cpp +++ b/native/tools/simulator/libsimulator/lib/runtime/Runtime.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "ConfigParser.h" #include "RuntimeProtocol.h" -#if ((CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)) +#if ((CC_PLATFORM == CC_PLATFORM_WINDOWS) || (CC_PLATFORM == CC_PLATFORM_MAC_OSX)) #include "DeviceEx.h" #include "network/CCHTTPRequest.h" #include "xxhash/xxhash.h" @@ -134,7 +134,7 @@ void RuntimeEngine::setupRuntime() // get project type fron config.json updateConfigParser(); auto entryFile = ConfigParser::getInstance()->getEntryFile(); -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#if (CC_PLATFORM != CC_PLATFORM_WINDOWS) && (CC_PLATFORM != CC_PLATFORM_MAC_OSX) ConfigParser::getInstance()->readConfig(); entryFile = ConfigParser::getInstance()->getEntryFile(); #endif @@ -155,13 +155,13 @@ const ProjectConfig &RuntimeEngine::getProjectConfig() void RuntimeEngine::setProjectPath(const std::string &workPath) { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS || CC_PLATFORM == CC_PLATFORM_MAC_OSX) vector searchPathArray = cocos2d::FileUtils::getInstance()->getSearchPaths(); if (workPath.empty()) { std::string appPath = std::string(""); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) TCHAR szAppDir[MAX_PATH] = { 0 }; if (GetModuleFileName(NULL, szAppDir, MAX_PATH)) { @@ -182,7 +182,7 @@ void RuntimeEngine::setProjectPath(const std::string &workPath) _fullpath(fuldir, strPath.c_str(), MAX_PATH); appPath = fuldir; } -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#elif (CC_PLATFORM == CC_PLATFORM_MAC_OSX) appPath.append("/../../../"); #endif appPath = replaceAll(appPath, "\\", "/"); @@ -217,7 +217,7 @@ void RuntimeEngine::startScript(const std::string &args) void RuntimeEngine::start() { -#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) +#if (CC_PLATFORM != CC_PLATFORM_WINDOWS) && (CC_PLATFORM != CC_PLATFORM_MAC_OSX) _project.setDebuggerType(kCCRuntimeDebuggerCodeIDE); #endif @@ -312,11 +312,11 @@ void RuntimeEngine::trackEvent(const std::string &eventName) return ; } -#if ((CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)) +#if ((CC_PLATFORM == CC_PLATFORM_WINDOWS) || (CC_PLATFORM == CC_PLATFORM_MAC_OSX)) -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) const char *platform = "win"; -#elif (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) +#elif (CC_PLATFORM == CC_PLATFORM_MAC_OSX) const char *platform = "mac"; #else const char *platform = "UNKNOWN"; @@ -341,7 +341,7 @@ void RuntimeEngine::trackEvent(const std::string &eventName) request->start(); */ -#endif // ((CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)) +#endif // ((CC_PLATFORM == CC_PLATFORM_WINDOWS) || (CC_PLATFORM == CC_PLATFORM_MAC_OSX)) } void RuntimeEngine::trackLaunchEvent() diff --git a/native/tools/tojs/cocos2dx_audioengine.ini b/native/tools/tojs/cocos2dx_audioengine.ini index 945e708340..0635dda984 100644 --- a/native/tools/tojs/cocos2dx_audioengine.ini +++ b/native/tools/tojs/cocos2dx_audioengine.ini @@ -7,7 +7,7 @@ prefix = audioengine # all classes will be embedded in that namespace target_namespace = jsb -macro_judgement = #if (USE_AUDIO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +macro_judgement = #if (USE_AUDIO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) android_headers = diff --git a/native/tools/tojs/cocos2dx_network.ini b/native/tools/tojs/cocos2dx_network.ini index 917001b3fd..7ed9f8208f 100644 --- a/native/tools/tojs/cocos2dx_network.ini +++ b/native/tools/tojs/cocos2dx_network.ini @@ -7,7 +7,7 @@ prefix = network # all classes will be embedded in that namespace target_namespace = jsb -macro_judgement = #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +macro_judgement = #if (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) android_headers = diff --git a/native/tools/tojs/cocos2dx_video.ini b/native/tools/tojs/cocos2dx_video.ini index 5c0bd8a387..0429656c83 100644 --- a/native/tools/tojs/cocos2dx_video.ini +++ b/native/tools/tojs/cocos2dx_video.ini @@ -7,7 +7,7 @@ prefix = video # all classes will be embedded in that namespace target_namespace = jsb -macro_judgement = #if (USE_VIDEO > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +macro_judgement = #if (USE_VIDEO > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) android_headers = diff --git a/native/tools/tojs/cocos2dx_webview.ini b/native/tools/tojs/cocos2dx_webview.ini index dc305d0c21..456d1717c0 100644 --- a/native/tools/tojs/cocos2dx_webview.ini +++ b/native/tools/tojs/cocos2dx_webview.ini @@ -7,7 +7,7 @@ prefix = webview # all classes will be embedded in that namespace target_namespace = jsb -macro_judgement = #if (USE_WEB_VIEW > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && !defined(CC_TARGET_OS_TVOS) +macro_judgement = #if (USE_WEB_VIEW > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS) && !defined(CC_TARGET_OS_TVOS) android_headers = diff --git a/native/tools/tojs/gfx.ini b/native/tools/tojs/gfx.ini index add98ce26b..f9d43d152a 100644 --- a/native/tools/tojs/gfx.ini +++ b/native/tools/tojs/gfx.ini @@ -7,7 +7,7 @@ prefix = gfx # all classes will be embedded in that namespace target_namespace = gfx -macro_judgement = #if (USE_GFX_RENDERER > 0) && (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +macro_judgement = #if (USE_GFX_RENDERER > 0) && (CC_PLATFORM == CC_PLATFORM_ANDROID || CC_PLATFORM == CC_PLATFORM_MAC_IOS || CC_PLATFORM == CC_PLATFORM_MAC_OSX || CC_PLATFORM == CC_PLATFORM_WINDOWS) android_headers =