Browse Source

Use the proper form of EMSCRIPTEN define throughout.

Lasse Öörni 9 years ago
parent
commit
96451d891e

+ 1 - 1
Source/ThirdParty/AngelScript/include/angelscript.h

@@ -37,7 +37,7 @@
 //
 
 // Urho3D: Define AS_MAX_PORTABILITY for Web builds and when specifically requested (This could be moved to the CMake files)
-#if defined(EMSCRIPTEN) || defined(FORCE_AS_PORTABLE)
+#if defined(__EMSCRIPTEN__) || defined(FORCE_AS_PORTABLE)
 #define AS_MAX_PORTABILITY
 #endif
 

+ 1 - 1
Source/ThirdParty/AngelScript/include/wrapmacros.h

@@ -23,7 +23,7 @@
 #pragma once
 
 //only use this file if we are in a web build or the portable (wrapped) code has been specifically requested
-#if defined(EMSCRIPTEN) || defined(FORCE_AS_PORTABLE)
+#if defined(__EMSCRIPTEN__) || defined(FORCE_AS_PORTABLE)
 
 //the template wrapper code
 #include "wrap16.h"

+ 2 - 2
Source/Tools/Urho3DPlayer/Urho3DPlayer.cpp

@@ -49,7 +49,7 @@ void Urho3DPlayer::Setup()
 {
     // Web platform depends on the resource system to read any data files. Skip parsing the command line file now
     // and try later when the resource system is live
-#ifndef EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
     // Read command line from a file if no arguments given. This is primarily intended for mobile platforms.
     // Note that the command file name uses a hardcoded path that does not utilize the resource system
     // properly (including resource path prefix), as the resource system is not yet initialized at this point
@@ -134,7 +134,7 @@ void Urho3DPlayer::Setup()
 void Urho3DPlayer::Start()
 {
     // Reattempt reading the command line now on Web platform
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
     if (GetArguments().Empty())
     {
         SharedPtr<File> commandFile = GetSubsystem<ResourceCache>()->GetFile("CommandLine.txt", false);

+ 6 - 6
Source/Urho3D/AngelScript/Script.cpp

@@ -85,8 +85,8 @@ Script::Script(Context* context) :
     scriptEngine_->SetEngineProperty(asEP_ALLOW_UNSAFE_REFERENCES, (asPWORD)true);
     scriptEngine_->SetEngineProperty(asEP_ALLOW_IMPLICIT_HANDLE_TYPES, (asPWORD)true);
     scriptEngine_->SetEngineProperty(asEP_BUILD_WITHOUT_LINE_CUES, (asPWORD)true);
-//use the copy of the original asMETHOD macro in a web build (for some reason it still works, presumably because the signature of the function is known)
-#if defined(EMSCRIPTEN) || defined(FORCE_AS_PORTABLE)
+// Use the copy of the original asMETHOD macro in a web build (for some reason it still works, presumably because the signature of the function is known)
+#if defined(__EMSCRIPTEN__) || defined(FORCE_AS_PORTABLE)
     scriptEngine_->SetMessageCallback(_asMETHOD(Script, MessageCallback), this, asCALL_THISCALL);
 #else
     scriptEngine_->SetMessageCallback(asMETHOD(Script, MessageCallback), this, asCALL_THISCALL);
@@ -94,8 +94,8 @@ Script::Script(Context* context) :
 
     // Create the context for immediate execution
     immediateContext_ = scriptEngine_->CreateContext();
-//use the copy of the original asMETHOD macro in a web build (for some reason it still works, presumably because the signature of the function is known)
-#if defined(EMSCRIPTEN) || defined(FORCE_AS_PORTABLE)
+// Use the copy of the original asMETHOD macro in a web build (for some reason it still works, presumably because the signature of the function is known)
+#if defined(__EMSCRIPTEN__) || defined(FORCE_AS_PORTABLE)
     immediateContext_->SetExceptionCallback(_asMETHOD(Script, ExceptionCallback), this, asCALL_THISCALL);
 #else
     immediateContext_->SetExceptionCallback(asMETHOD(Script, ExceptionCallback), this, asCALL_THISCALL);
@@ -313,8 +313,8 @@ asIScriptContext* Script::GetScriptFileContext()
     while (scriptNestingLevel_ >= scriptFileContexts_.Size())
     {
         asIScriptContext* newContext = scriptEngine_->CreateContext();
-//use the copy of the original asMETHOD macro in a web build (for some reason it still works, presumably because the signature of the function is known)
-#if defined(EMSCRIPTEN) || defined(FORCE_AS_PORTABLE)
+// Use the copy of the original asMETHOD macro in a web build (for some reason it still works, presumably because the signature of the function is known)
+#if defined(__EMSCRIPTEN__) || defined(FORCE_AS_PORTABLE)
         newContext->SetExceptionCallback(_asMETHOD(Script, ExceptionCallback), this, asCALL_THISCALL);
 #else
         newContext->SetExceptionCallback(asMETHOD(Script, ExceptionCallback), this, asCALL_THISCALL);