- for win32 dll, must export Widget class and array of Widget pointers
This commit is contained in:
parent
69da0e6c28
commit
3d53781ba6
@ -2,22 +2,22 @@
|
||||
# ifdef MAIN_DLL_EXPORT
|
||||
# ifdef DLL_EXPORT
|
||||
# warning I will export DLL symbols for MODULE1
|
||||
# define MAINAPI(type) __declspec(dllexport) type
|
||||
# define MAINAPI __declspec(dllexport)
|
||||
# endif
|
||||
# else
|
||||
# warning I will import DLL symbols for MODULE1
|
||||
# define MAINAPI(type) __declspec(dllimport) type
|
||||
# define MAINAPI __declspec(dllimport)
|
||||
# endif
|
||||
#endif
|
||||
#ifndef MAINAPI
|
||||
# warning No DLL import/export is needed
|
||||
# define MAINAPI(type) type
|
||||
# define MAINAPI
|
||||
#endif
|
||||
|
||||
typedef void (*modload_func)(void);
|
||||
|
||||
MAINAPI(extern const char *) version_string;
|
||||
MAINAPI(extern int) register_module (const char *name);
|
||||
MAINAPI extern const char * version_string;
|
||||
MAINAPI extern int register_module (const char *name);
|
||||
|
||||
// really, this should only be included in the modules. It would be
|
||||
// incorrect to call module_init from main, even if the compiler allowed
|
||||
@ -27,7 +27,7 @@ extern "C" {
|
||||
void module_init ();
|
||||
};
|
||||
|
||||
class Widget {
|
||||
class MAINAPI Widget {
|
||||
int id;
|
||||
const char *name;
|
||||
float weight;
|
||||
@ -40,4 +40,4 @@ public:
|
||||
};
|
||||
|
||||
#define MAX_WIDGETS 10
|
||||
extern Widget* widgets[MAX_WIDGETS];
|
||||
MAINAPI extern Widget* widgets[MAX_WIDGETS];
|
||||
|
Loading…
Reference in New Issue
Block a user