11#pragma once
2- #include < vector>
3-
42
53#ifdef _WIN32
6- #define DLLEXPORT_PREFIX __declspec (dllexport)
4+ #ifdef SQFVM_BUILD
5+ #define SQFVM_EXPORT __declspec(dllexport)
6+ #else
7+ #define SQFVM_EXPORT __declspec(dllimport)
8+ #endif
79#else
8- #define DLLEXPORT_PREFIX __attribute__ ((visibility(" default" )))
10+ #define SQFVM_EXPORT __attribute__((visibility("default")))
911#endif
1012
1113extern "C" {
@@ -27,24 +29,24 @@ extern "C" {
2729 // @param user_data Custom data from the callee that will be passed into callback
2830 // @param max_runtime_seconds the maximum runtime in seconds as float. Pass 0
2931 // Returns NULL on error
30- DLLEXPORT_PREFIX void * sqfvm_create_instance (void * user_data, sqfvm_log_callback callback, float max_runtime_seconds);
32+ SQFVM_EXPORT void * sqfvm_create_instance (void * user_data , sqfvm_log_callback callback , float max_runtime_seconds );
3133
3234 // Creates a new SQF-VM instance with the basic, non-arma specific operators loaded
3335 // @param callback The callback to report log messages on
3436 // @param user_data Custom data from the callee that will be passed into callback
3537 // @param max_runtime_seconds the maximum runtime in seconds as float. Pass 0
3638 // Returns NULL on error
37- DLLEXPORT_PREFIX void * sqfvm_create_instance_basic (void * user_data, sqfvm_log_callback callback, float max_runtime_seconds);
39+ SQFVM_EXPORT void * sqfvm_create_instance_basic (void * user_data , sqfvm_log_callback callback , float max_runtime_seconds );
3840
3941 // Creates a new SQF-VM instance without any operators loaded
4042 // @param callback The callback to report log messages on
4143 // @param user_data Custom data from the callee that will be passed into callback
4244 // @param max_runtime_seconds the maximum runtime in seconds as float. Pass 0
4345 // Returns NULL on error
44- DLLEXPORT_PREFIX void * sqfvm_create_instance_empty (void * user_data, sqfvm_log_callback callback, float max_runtime_seconds);
46+ SQFVM_EXPORT void * sqfvm_create_instance_empty (void * user_data , sqfvm_log_callback callback , float max_runtime_seconds );
4547
4648 // Destroys a previously created SQF-VM instance
47- DLLEXPORT_PREFIX void sqfvm_destroy_instance (void * instance);
49+ SQFVM_EXPORT void sqfvm_destroy_instance (void * instance );
4850
4951 // Loads the provided config into the config tree of the provided instance
5052 // @param instance A valid instance as returned from sqfvm_create_instance
@@ -54,7 +56,7 @@ extern "C" {
5456 // -1 if the instance was null
5557 // -2 if preprocessing failed
5658 // -3 if parsing failed
57- DLLEXPORT_PREFIX int32_t sqfvm_load_config (void * instance, const char * contents, uint32_t length);
59+ SQFVM_EXPORT int32_t sqfvm_load_config (void * instance , const char * contents , uint32_t length );
5860
5961 // Checks the status of the instance
6062 // @param instance A valid instance as returned from sqfvm_create_instance
@@ -65,7 +67,7 @@ extern "C" {
6567 // +3 Instance is in halted_error
6668 // +4 evaluating
6769 //
68- DLLEXPORT_PREFIX int32_t sqfvm_status (void * instance);
70+ SQFVM_EXPORT int32_t sqfvm_status (void * instance );
6971
7072 // Calls the provided code, using the SQF-VM instance.
7173 // @param instance A valid instance as returned from sqfvm_create_instance
@@ -86,5 +88,5 @@ extern "C" {
8688 // -4 if the instance is already running
8789 // -5 if the provided type was invalid
8890 // -6 if the execution did not succeed
89- DLLEXPORT_PREFIX int32_t sqfvm_call (void * instance, void * call_data, char type, const char * code, uint32_t length);
90- }
91+ SQFVM_EXPORT int32_t sqfvm_call (void * instance , void * call_data , char type , const char * code , uint32_t length );
92+ }
0 commit comments