Skip to content

Commit

Permalink
Move some import export defines to common engine header
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Nov 11, 2017
1 parent a16f29d commit f802a73
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 120 deletions.
3 changes: 3 additions & 0 deletions src/Common/Common.hpp
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#pragma once

#include "Common/CommonImportExport.inl"

3 changes: 3 additions & 0 deletions src/Common/Common.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@
<ItemGroup>
<ClCompile Include="NvMender2003\NVMeshMender.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="CommonImportExport.inl" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/Common/Common.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,7 @@
<Filter>NvMender2003</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="CommonImportExport.inl" />
</ItemGroup>
</Project>
61 changes: 61 additions & 0 deletions src/Common/CommonImportExport.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#pragma once

#ifdef XRAPI_EXPORTS
#define XRAPI_API XR_EXPORT
#else
#define XRAPI_API XR_IMPORT
#endif

#ifdef XRAICORE_EXPORTS
#define XRAICORE_API XR_EXPORT
#else
#define XRAICORE_API XR_IMPORT
#endif

#ifdef XRCDB_EXPORTS
#define XRCDB_API XR_EXPORT
#else
#define XRCDB_API XR_IMPORT
#endif

#ifdef XRCORE_EXPORTS
#define XRCORE_API XR_EXPORT
#else
#define XRCORE_API XR_IMPORT
#endif

#ifdef XRGAMESPY_EXPORTS
#define XRGAMESPY_API XR_EXPORT
#else
#define XRGAMESPY_API XR_IMPORT
#endif

#ifdef XR_NETSERVER_EXPORTS
#define XRNETSERVER_API XR_EXPORT
#else
#define XRNETSERVER_API XR_IMPORT
#endif

#ifdef XR_PARTICLES_EXPORTS
#define PARTICLES_API XR_EXPORT
#else
#define PARTICLES_API XR_IMPORT
#endif

#ifdef XRPHYSICS_EXPORTS
#define XRPHYSICS_API XR_EXPORT
#else
#define XRPHYSICS_API XR_IMPORT
#endif

#ifdef XRSCRIPTENGINE_EXPORTS
#define XRSCRIPTENGINE_API XR_EXPORT
#else
#define XRSCRIPTENGINE_API XR_IMPORT
#endif

#ifdef XRSOUND_EXPORTS
#define XRSOUND_API XR_EXPORT
#else
#define XRSOUND_API XR_IMPORT
#endif
6 changes: 0 additions & 6 deletions src/Include/xrAPI/xrAPI.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#pragma once

#ifdef XRAPI_EXPORTS
#define XRAPI_API XR_EXPORT
#else
#define XRAPI_API XR_IMPORT
#endif

class IRender;
class IRenderFactory;
class IDebugRender;
Expand Down
6 changes: 0 additions & 6 deletions src/xrAICore/xrAICore.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
#pragma once

#ifdef XRAICORE_EXPORTS
#define XRAICORE_API XR_EXPORT
#else
#define XRAICORE_API XR_IMPORT
#endif
13 changes: 0 additions & 13 deletions src/xrCDB/xrCDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@

#include "xrCore/Threading/Lock.hpp" // XXX: Remove from header. Put in .cpp.

// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the XRCDB_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// XRCDB_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.

#ifdef XRCDB_EXPORTS
#define XRCDB_API XR_EXPORT
#else
#define XRCDB_API XR_IMPORT
#endif

// forward declarations
class CFrustum;
namespace Opcode
Expand Down
1 change: 0 additions & 1 deletion src/xrCore/FTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#ifndef FTimerH
#define FTimerH
#include "_types.h"
#include "xrCore_impexp.h"
#include "xrCommon/xr_vector.h"
//#include "_stl_extensions.h"
#include "_math.h"
Expand Down
2 changes: 0 additions & 2 deletions src/xrCore/Threading/Lock.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#include "xrCore/xrCore_impexp.h"

#include <mutex>
#include <atomic>

Expand Down
1 change: 0 additions & 1 deletion src/xrCore/_compressed_normal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#ifndef _COMPR_NORMAL_
#define _COMPR_NORMAL_
#include "xrCore/_types.h"
#include "xrCore/xrCore_impexp.h"

// fwd. decl.
template <class T> struct _vector3; typedef _vector3<float> Fvector;
Expand Down
1 change: 0 additions & 1 deletion src/xrCore/_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "_types.h"
#include "cpuid.h"
#include "xrCore_impexp.h"
#include "xrCommon/inlining_macros.h"
#ifdef _MSC_VER
#include <intrin.h> // __rdtsc
Expand Down
1 change: 0 additions & 1 deletion src/xrCore/_random.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define _LOCAL_RAND
#include "_types.h"
#include "xrCommon/inlining_macros.h"
#include "xrCore_impexp.h"
#include "xrCore/xrDebug.h"

/*
Expand Down
1 change: 0 additions & 1 deletion src/xrCore/_std_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <math.h>
#include <float.h>
#include <stdio.h>
#include "xrCore/xrCore_impexp.h"
#include "xrCommon/math_funcs_inline.h"

#define BREAK_AT_STRCMP
Expand Down
1 change: 0 additions & 1 deletion src/xrCore/log.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#ifndef logH
#define logH
#include "xrCore_impexp.h"
#include "xrCommon/xr_vector.h"

// fwd. decl.
Expand Down
1 change: 0 additions & 1 deletion src/xrCore/memory_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#ifdef USE_MEMORY_MONITOR

#include "xrCore_impexp.h"
#include "_types.h"

namespace memory_monitor
Expand Down
2 changes: 0 additions & 2 deletions src/xrCore/xrCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@
#endif // frequently in release code due to large amount of VERIFY

// Our headers
#include "xrCore_impexp.h"

#include "xrDebug.h"
//#include "vector.h"

Expand Down
11 changes: 0 additions & 11 deletions src/xrCore/xrCore_impexp.h

This file was deleted.

1 change: 0 additions & 1 deletion src/xrCore/xrMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#define xrMemoryH

#include "memory_monitor.h"
#include "xrCore/xrCore_impexp.h"

#ifdef USE_MEMORY_MONITOR
#define DEBUG_MEMORY_NAME
Expand Down
1 change: 0 additions & 1 deletion src/xrCore/xr_resource.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#ifndef xr_resourceH
#define xr_resourceH
#include "xrCore_impexp.h"
#include "xrstring.h"

// resource itself, the base class for all derived resources
Expand Down
1 change: 0 additions & 1 deletion src/xrCore/xrsharedmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#define xrsharedmemH

//#include "_stl_extensions.h"
#include "xrCore_impexp.h"
#include "xrCommon/xr_vector.h"

// fwd. decl.
Expand Down
1 change: 0 additions & 1 deletion src/xrCore/xrstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#pragma once

// TODO: tamlin: Get rid of _std_extensions.h as compile-time dependency, if possible.
#include "xrCore_impexp.h"
#include "_types.h"
#include "_std_extensions.h"

Expand Down
30 changes: 15 additions & 15 deletions src/xrEngine/xrEngine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
</ResourceCompile>
<Link>
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Debug;$(xrExternals)libtheora\win32\lib\$(Platform)\Debug;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<MapExports>false</MapExports>
Expand Down Expand Up @@ -304,7 +304,7 @@
</ResourceCompile>
<Link>
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Debug;$(xrExternals)libtheora\win32\lib\$(Platform)\Debug;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<MapExports>false</MapExports>
Expand Down Expand Up @@ -344,7 +344,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libog\win32\lib\$(Platform)\Release;$(xrExternals)libtheora\win32\lib\$(Platform)\Release;$(xrLibRootDir)Mixed;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -381,7 +381,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libog\win32\lib\$(Platform)\Release;$(xrExternals)libtheora\win32\lib\$(Platform)\Release;$(xrLibRootDir)Mixed;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -421,7 +421,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Release;$(xrExternals)libtheora\win32\lib\$(Platform)\Release;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -465,7 +465,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Release;$(xrExternals)libtheora\win32\lib\$(Platform)\Release;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -509,7 +509,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Debug;$(xrExternals)libtheora\win32\lib\$(Platform)\Debug;$(xrLibRootDir)$(Platform)\Debug;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<MapExports>false</MapExports>
Expand Down Expand Up @@ -551,7 +551,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Debug;$(xrExternals)libtheora\win32\lib\$(Platform)\Debug;$(xrLibRootDir)$(Platform)\Debug;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<MapExports>false</MapExports>
Expand Down Expand Up @@ -590,7 +590,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Release;$(xrExternals)libtheora\win32\lib\$(Platform)\Release;$(xrLibRootDir)$(Platform)\Mixed;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -629,7 +629,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Release;$(xrExternals)libtheora\win32\lib\$(Platform)\Release;$(xrLibRootDir)$(Platform)\Mixed;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -669,7 +669,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Release;$(xrExternals)libtheora\win32\lib\$(Platform)\Release;$(xrLibRootDir)$(Platform)\Release;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -713,7 +713,7 @@
<Culture>0x0422</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>xrPhysics.lib;LuaJIT.lib;vfw32.lib;libogg_static.lib;libtheora_static.lib;oalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(xrExternals)OpenAutomate\libraries;$(xrExternals)libogg\win32\lib\$(Platform)\Release;$(xrExternals)libtheora\win32\lib\$(Platform)\Release;$(xrLibRootDir)$(Platform)\Release;$(xrExternals)luajit\bin\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<SubSystem>Windows</SubSystem>
Expand Down Expand Up @@ -1005,9 +1005,6 @@
<ProjectReference Include="$(xrExternals)luabind\src\luabind.vcxproj">
<Project>{ccd4afae-aa10-42c6-a452-fdee497ccdf1}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)xrPhysics\xrPhysics.vcxproj">
<Project>{98d24a3d-7666-4c11-9d6e-b10393ce8cba}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)xrScriptEngine\xrScriptEngine.vcxproj">
<Project>{132c62de-de85-4978-9675-c78ed4da46f0}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
Expand All @@ -1018,6 +1015,9 @@
<ProjectReference Include="..\utils\xrMiscMath\xrMiscMath.vcxproj">
<Project>{7885cf3c-ee04-4c67-9467-1fbf9a36b037}</Project>
</ProjectReference>
<ProjectReference Include="..\xrPhysics\xrPhysics.vcxproj">
<Project>{98d24a3d-7666-4c11-9d6e-b10393ce8cba}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
Loading

0 comments on commit f802a73

Please sign in to comment.