瀏覽代碼

Fix build with python 3

Kartik Mohta 7 年之前
父節點
當前提交
037022be2b
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      matplotlibcpp.h

+ 5 - 1
matplotlibcpp.h

@@ -72,15 +72,19 @@ namespace matplotlibcpp {
 			}
 
 			private:
+#ifndef WITHOUT_NUMPY
 #if PY_MAJOR_VERSION >= 3
-			int import_numpy() {
+			void *import_numpy() {
 				import_array(); // initialize C-API
+				return NULL;
 			}
 #else
 			void import_numpy() {
 				import_array(); // initialize C-API
 			}
 #endif
+#endif
+
 			_interpreter() {
 
                 // optional but recommended