mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +02:00
Fixed linker problems.
This commit is contained in:
parent
48581962ab
commit
64f098017b
@ -1,8 +1,6 @@
|
||||
#ifndef __GENIUS_COMMON__
|
||||
#define __GENIUS_COMMON__
|
||||
|
||||
#define VCMI_DLL
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define strcpy_s(a, b, c) strncpy(a, c, b)
|
||||
#endif
|
||||
|
@ -1,4 +1,3 @@
|
||||
#define VCMI_DLL
|
||||
#pragma warning (disable: 4100 4251 4245 4018 4081)
|
||||
#include "../../AI_Base.h"
|
||||
#pragma warning (default: 4100 4251 4245 4018 4081)
|
||||
@ -9,28 +8,28 @@ using namespace GeniusAI;
|
||||
|
||||
const char *g_cszAiName = "Genius 1.0";
|
||||
|
||||
extern "C" DLL_EXPORT int GetGlobalAiVersion()
|
||||
extern "C" DLL_F_EXPORT int GetGlobalAiVersion()
|
||||
{
|
||||
return AI_INTERFACE_VER;
|
||||
}
|
||||
|
||||
extern "C" DLL_EXPORT void GetAiName(char* name)
|
||||
extern "C" DLL_F_EXPORT void GetAiName(char* name)
|
||||
{
|
||||
strcpy_s(name, strlen(g_cszAiName) + 1, g_cszAiName);
|
||||
}
|
||||
|
||||
extern "C" DLL_EXPORT char* GetAiNameS()
|
||||
extern "C" DLL_F_EXPORT char* GetAiNameS()
|
||||
{
|
||||
// need to be defined
|
||||
return NULL;
|
||||
}
|
||||
|
||||
extern "C" DLL_EXPORT CGlobalAI* GetNewAI()
|
||||
extern "C" DLL_F_EXPORT CGlobalAI* GetNewAI()
|
||||
{
|
||||
return new CGeniusAI();
|
||||
}
|
||||
|
||||
extern "C" DLL_EXPORT void ReleaseAI(CGlobalAI* i)
|
||||
extern "C" DLL_F_EXPORT void ReleaseAI(CGlobalAI* i)
|
||||
{
|
||||
delete (CGeniusAI*)i;
|
||||
}
|
28
global.h
28
global.h
@ -84,20 +84,34 @@ const int SPELL_LEVELS = 5;
|
||||
|
||||
#define DEFBYPASS
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef VCMI_DLL
|
||||
#define DLL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define DLL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
#define DLL_F_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
#define DLL_EXPORT __attribute__ ((visibility("default")))
|
||||
#define DLL_F_EXPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define DLL_EXPORT
|
||||
#define DLL_F_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define DLL_F_IMPORT __declspec(dllimport)
|
||||
#else
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
#define DLL_F_IMPORT __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define DLL_F_IMPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VCMI_DLL
|
||||
#define DLL_EXPORT DLL_F_EXPORT
|
||||
#else
|
||||
#define DLL_EXPORT DLL_F_IMPORT
|
||||
#endif
|
||||
|
||||
template<typename T, size_t N> char (&_ArrayCountObj(const T (&)[N]))[N];
|
||||
#define ARRAY_COUNT(arr) (sizeof(_ArrayCountObj(arr)))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user