SO3Engine
SO3MsWindows.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
32#ifndef __SO3_MS_WINDOWS_H__
33#define __SO3_MS_WINDOWS_H__
34
35// Activate memory leaks detection.
36#if defined(_DEBUG)
37//# define SO3_DEBUG 1
38# define _CRTDBG_MAP_ALLOC
39# include <stdlib.h>
40# include <crtdbg.h>
41#endif
42
43#define WIN32_LEAN_AND_MEAN
44#define NOMINMAX
45#include "windows.h"
46
47// Dll exporting symbols (SO3Engine.dll build), or importing (SO3 plugins)?
48#ifdef SO3_STATIC_BUILD
49# define _SO3_Export
50#else
51# ifdef SO3_NON_CLIENT_BUILD
52# define _SO3_Export __declspec(dllexport)
53# else
54# define _SO3_Export __declspec(dllimport)
55# endif
56#endif
57
58// Ms Windows dynamic library loading and unloading functions.
59// see SPlugin class
60#define SO3_PLUGIN_INSTANCE hInstance
61#define SO3_PLUGIN_LOAD(a) LoadLibrary(a)
62#define SO3_PLUGIN_UNLOAD(a) !FreeLibrary(a)
63#define SO3_PLUGIN_GET_SYMBOL(a,b) (void*)GetProcAddress(a,b)
64#define SO3_PLUGIN_ERROR() "Unknown Error"
65struct HINSTANCE__;
66typedef struct HINSTANCE__* hInstance;
67
68#endif
struct HINSTANCE__ * hInstance