Skip to content

Commit ac0d605

Browse files
define preprocessor variable for inline keyword, and define it empty for VS 9.0 and older to make py27 build work on Windows
1 parent 3f9fed6 commit ac0d605

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

mkl/_mklinitmodule.c

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,15 @@ static struct PyMethodDef methods[] = {
2323
{NULL, NULL, 0, NULL}
2424
};
2525

26-
static inline void _set_mkl_ilp64() {
27-
#ifdef USING_MKL_RT
28-
int i = mkl_set_interface_layer(MKL_INTERFACE_ILP64);
26+
#if defined(_MSC_VER) && (_MSC_VER <= 1500)
27+
#define MKL_SERVICE_INLINE
28+
#else
29+
#define MKL_SERVICE_INLINE inline
2930
#endif
30-
return;
31-
}
3231

33-
static inline void _set_mkl_lp64() {
34-
#ifdef USING_MKL_RT
35-
int i = mkl_set_interface_layer(MKL_INTERFACE_LP64);
36-
#endif
37-
return;
38-
}
32+
static MKL_SERVICE_INLINE void _set_mkl_ilp64();
33+
static MKL_SERVICE_INLINE void _set_mkl_lp64();
34+
static MKL_SERVICE_INLINE void _set_mkl_interface();
3935

4036
static void _preload_threading_layer() {
4137
#if FORCE_PRELOADING
@@ -112,7 +108,21 @@ static void _preload_threading_layer() {
112108
return;
113109
}
114110

115-
static inline void _set_mkl_interface() {
111+
static MKL_SERVICE_INLINE void _set_mkl_ilp64() {
112+
#ifdef USING_MKL_RT
113+
int i = mkl_set_interface_layer(MKL_INTERFACE_ILP64);
114+
#endif
115+
return;
116+
}
117+
118+
static MKL_SERVICE_INLINE void _set_mkl_lp64() {
119+
#ifdef USING_MKL_RT
120+
int i = mkl_set_interface_layer(MKL_INTERFACE_LP64);
121+
#endif
122+
return;
123+
}
124+
125+
static MKL_SERVICE_INLINE void _set_mkl_interface() {
116126
_set_mkl_lp64();
117127
_preload_threading_layer();
118128
}

0 commit comments

Comments
 (0)