-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Windows compatibility and function exports
Comment out static linking options in CMakeLists.txt. Add Windows-specific includes and DllMain definition in DllMain.cpp. Define DLLEXPORT macro in exportedfunctions.cpp for cross-compiler compatibility.
- Loading branch information
Showing
3 changed files
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
#include <include/function.h> | ||
|
||
extern "C" __declspec(dllexport) void mexFunction(int nlhs, Parameter plhs[], int nrhs, const Parameter prhs[], IAppExtensionFunctions* app_functions) | ||
#ifdef __GNUC__ | ||
#define DLLEXPORT __attribute__((visibility("default"))) | ||
#else | ||
#define DLLEXPORT __declspec(dllexport) | ||
#endif | ||
|
||
extern "C" DLLEXPORT void mexFunction(int nlhs, Parameter plhs[], int nrhs, const Parameter prhs[], IAppExtensionFunctions* app_functions) | ||
{ | ||
mexlibCZI::mexFunction(nlhs, plhs, nrhs, prhs, app_functions); | ||
} | ||
|
||
extern "C" __declspec(dllexport) void OnInitialize() | ||
extern "C" DLLEXPORT void OnInitialize() | ||
{ | ||
mexlibCZI::OnInitialize(); | ||
} | ||
|
||
extern "C" __declspec(dllexport) void OnShutdown() | ||
extern "C" DLLEXPORT void OnShutdown() | ||
{ | ||
mexlibCZI::OnShutdown(); | ||
} |