Skip to content

Commit 5066e3e

Browse files
committed
Project (mostly) abstracted from dllimport/dllexport declarations.
xrCore/Platform: Introduced XR_IMPORT/EXPORT macros.
1 parent 9c99195 commit 5066e3e

File tree

30 files changed

+109
-55
lines changed

30 files changed

+109
-55
lines changed

src/Include/xrAPI/xrAPI.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#pragma once
22

3+
#include "xrCore/Platform.h"
4+
35
#ifdef XRAPI_EXPORTS
4-
#define XRAPI_API __declspec(dllexport)
6+
#define XRAPI_API XR_EXPORT
57
#else
6-
#define XRAPI_API __declspec(dllimport)
8+
#define XRAPI_API XR_IMPORT
79
#endif
810

911
class IRender;

src/utils/xrAI/factory_api.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#pragma once
22

3+
#include "xrCore/Platform.h"
4+
35
extern "C" {
4-
typedef __declspec(dllimport) ISE_Abstract* __stdcall Factory_Create (LPCSTR section);
5-
typedef __declspec(dllimport) void __stdcall Factory_Destroy (ISE_Abstract *&);
6+
typedef XR_IMPORT ISE_Abstract* __stdcall Factory_Create (LPCSTR section);
7+
typedef XR_IMPORT void __stdcall Factory_Destroy (ISE_Abstract *&);
68
};
79

810
extern Factory_Create *create_entity;

src/utils/xrLC/Build.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#pragma once
2+
#include "xrCore/Platform.h"
23
#include "xrCore/FS.h"
34
#include "utils/Shader_xrLC.h"
45
struct STextureParams;
56
#pragma comment(lib,"dxt.lib")
6-
extern "C" bool __declspec(dllimport) __stdcall DXTCompress(LPCSTR out_name, u8* raw_data, u8* normal_map, u32 w, u32 h, u32 pitch, STextureParams* fmt, u32 depth);
7+
extern "C" bool XR_IMPORT __stdcall DXTCompress(LPCSTR out_name, u8* raw_data, u8* normal_map, u32 w, u32 h, u32 pitch, STextureParams* fmt, u32 depth);
78

89
#include "utils/xrLC_Light/b_build_texture.h"
910
#include "utils/xrLC_Light/xrfacedefs.h"

src/utils/xrLCUtil/xrLCUtil.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
#pragma comment(lib, "winmm.lib")
55
#pragma comment(lib, "comctl32.lib")
66

7+
#include "xrCore/Platform.h"
8+
79
#ifdef XRLCUTIL_EXPORTS
8-
#define XRLCUTIL_API __declspec(dllexport)
10+
#define XRLCUTIL_API XR_EXPORT
911
#else
10-
#define XRLCUTIL_API __declspec(dllimport)
12+
#define XRLCUTIL_API XR_IMPORT
1113
#endif
1214

1315
XRLCUTIL_API std::string make_time(u32 sec);

src/utils/xrLC_Light/xrDXTC.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#pragma once
22

3+
#include "xrCore/Platform.h"
4+
35
#ifdef XRDXTC_EXPORTS
4-
#define DXTC_API __declspec(dllexport)
6+
#define DXTC_API XR_EXPORT
57
#else
6-
#define DXTC_API __declspec(dllimport)
8+
#define DXTC_API XR_IMPORT
79
#endif
810

911
enum eDXTC

src/utils/xrLC_Light/xrLC_Light.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#pragma once
22

3+
#include "xrCore/Platform.h"
34
#include "xrCore/xrCore.h"
45
#ifdef XRLC_LIGHT_EXPORTS
5-
# define XRLC_LIGHT_API __declspec(dllexport)
6+
# define XRLC_LIGHT_API XR_EXPORT
67
#else
7-
# define XRLC_LIGHT_API __declspec(dllimport)
8+
# define XRLC_LIGHT_API XR_IMPORT
89
#endif
910

1011
#pragma warning(disable:4995)

src/utils/xrLC_Light/xrLight_Implicit.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "stdafx.h"
22

3+
#include "xrCore/Platform.h"
4+
35
#include "xrlight_implicit.h"
46
#include "xrLight_ImplicitDeflector.h"
57
#include "xrlight_implicitrun.h"
@@ -11,7 +13,7 @@
1113
#include "net_task_callback.h"
1214
#include "xrCDB/xrCDB.h"
1315

14-
extern "C" bool __declspec(dllimport) __stdcall DXTCompress(LPCSTR out_name, u8* raw_data, u8* normal_map, u32 w, u32 h, u32 pitch, STextureParams* fmt, u32 depth);
16+
extern "C" bool XR_IMPORT __stdcall DXTCompress(LPCSTR out_name, u8* raw_data, u8* normal_map, u32 w, u32 h, u32 pitch, STextureParams* fmt, u32 depth);
1517

1618
DEF_MAP(Implicit,u32,ImplicitDeflector);
1719

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#pragma once
22

3+
#include "xrCore/Platform.h"
4+
35
#ifdef XRLC_LIGHT_STAB_EXPORTS
4-
# define XRLC_LIGHT_STUB_API __declspec(dllexport)
6+
# define XRLC_LIGHT_STUB_API XR_EXPORT
57
#else
6-
# define XRLC_LIGHT_STUB_API __declspec(dllimport)
8+
# define XRLC_LIGHT_STUB_API XR_IMPORT
79
#endif
810

911

10-
# define XRLC_LIGHT_API __declspec(dllimport)
12+
# define XRLC_LIGHT_API XR_IMPORT

src/utils/xrSE_Factory/xrSE_Factory_import_export.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#ifndef XRSE_FACTORY_IMPORT_EXPORTH
22
#define XRSE_FACTORY_IMPORT_EXPORTH
33

4+
#include "xrCore/Platform.h"
5+
46
#ifdef XRSE_FACTORY_EXPORTS
5-
# define FACTORY_API __declspec(dllexport)
7+
# define FACTORY_API XR_EXPORT
68
#else
7-
# define FACTORY_API __declspec(dllimport)
9+
# define FACTORY_API XR_IMPORT
810
#endif
911

1012
extern "C" {

src/xrAICore/xrAICore.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#pragma once
22

3+
#include "xrCore/Platform.h"
4+
35
#ifdef XRAICORE_EXPORTS
4-
#define XRAICORE_API __declspec(dllexport)
6+
#define XRAICORE_API XR_EXPORT
57
#else
6-
#define XRAICORE_API __declspec(dllimport)
8+
#define XRAICORE_API XR_IMPORT
79
#endif

0 commit comments

Comments
 (0)