summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-10-15 13:22:35 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-10-15 13:23:01 +0200
commitc1e08d60e51ce515273a6e5b9d31db5425025a58 (patch)
tree61ec60bcfffcf107ca409fd396e6c8da9b41df2e
parent6f3dedb2791efd26f17d332d00650aceb49c31f7 (diff)
fix vjoy the hard way
-rw-r--r--ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h15
-rw-r--r--ftnoir_protocol_vjoy/vjoy.def5
2 files changed, 17 insertions, 3 deletions
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h
index 30c4b9b5..5a1d30fb 100644
--- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h
+++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h
@@ -115,6 +115,15 @@ typedef struct _JOYSTICK_STATE
#include <poppack.h>
-extern "C" BOOL __stdcall VJoy_Initialize(PCHAR name, PCHAR serial);
-extern "C" VOID __stdcall VJoy_Shutdown();
-extern "C" BOOL __stdcall VJoy_UpdateJoyState(int id, PJOYSTICK_STATE pJoyState);
+#undef EXTERN_C
+#if _MSC_VER
+# define EXTERN_C
+#else
+# define EXTERN_C extern "C"
+#endif
+#if _MSC_VER
+# pragma comment(linker, "/implib:vjoy.def")
+#endif
+EXTERN_C BOOL __stdcall VJoy_Initialize(PCHAR name, PCHAR serial);
+EXTERN_C VOID __stdcall VJoy_Shutdown();
+EXTERN_C BOOL __stdcall VJoy_UpdateJoyState(int id, PJOYSTICK_STATE pJoyState);
diff --git a/ftnoir_protocol_vjoy/vjoy.def b/ftnoir_protocol_vjoy/vjoy.def
new file mode 100644
index 00000000..aea590a4
--- /dev/null
+++ b/ftnoir_protocol_vjoy/vjoy.def
@@ -0,0 +1,5 @@
+LIBRARY vjoy.dll
+IMPORTS
+VJoy_Initialize = _VJoy_Initialize
+VJoy_Shutdown = _VJoy_Shutdown
+VJoy_UpdateJoyState = _VJoy_UpdateJoyState