diff --git a/pyniflib.i b/pyniflib.i
index a2e919e39947c183aab438e7f8fbc922b36e9498..78cc4c3d26471956716678f83c9f5cbd7f0d99c0 100644
--- a/pyniflib.i
+++ b/pyniflib.i
@@ -63,6 +63,9 @@ POSSIBILITY OF SUCH DAMAGE. */
 }
 #endif
 
+// we need to define this because the wrapper gets confused about NIFLIB_API'd functions otherwise
+#define NIFLIB_API
+
 %{
 	#include "niflib.h"
 %}