--- a/src/lib/openjp2/openjpeg.h
+++ b/src/lib/openjp2/openjpeg.h
@@ -76,6 +76,12 @@
 #define OPJ_DEPRECATED(func) func
 #endif
 
+#if defined(_ARM_)
+#define OPJ_CALLCONV
+#else
+#define OPJ_CALLCONV __stdcall
+#endif
+
 #if defined(OPJ_STATIC) || !defined(_WIN32)
 /* http://gcc.gnu.org/wiki/Visibility */
 #   if !defined(_WIN32) && __GNUC__ >= 4
@@ -89,9 +95,7 @@
 #       define OPJ_API
 #       define OPJ_LOCAL
 #   endif
-#   define OPJ_CALLCONV
 #else
-#   define OPJ_CALLCONV __stdcall
 /*
 The following ifdef block is the standard way of creating macros which make exporting
 from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS
