From a7f0b507f7797189fab289472541d3db7105768e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20H=C3=B6ger?= Date: Sat, 16 Jun 2012 16:09:20 +0200 Subject: [PATCH 06/14] MSVC does not support inline, so just #def it --- CMakeLists.txt | 7 ++++++- _dbus_bindings/dbus_bindings-internal.h | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2bfc27..fc8548b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,11 @@ endif(NOT PYTHONLIBS_FOUND OR NOT PYTHON_EXECUTABLE) # The code below prints the Python extension for the current system set(get_python_suffix "import imp ; print(list(filter(lambda s : s[1] == 'rb' and s[0][0] == '.', imp.get_suffixes()))[0][0])") +find_file(stdint stdint.h) +if(NOT stdint) + message(SEND_ERROR "You need a C99 compliant stdint.h for windows, use e.g. http://msinttypes.googlecode.com/svn/trunk/stdint.h") +endif(NOT stdint) + execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "${get_python_suffix}" OUTPUT_VARIABLE _modsuffix @@ -57,7 +62,7 @@ target_link_libraries(_dbus_bindings ${PYTHON_LIBRARIES} ${DBUS_LIBRARY}) include_directories(_dbus_glib_bindings/ ${GLIB_INCLUDE_DIR} ${GLIB_CONFIG_INCLUDE_DIR}) file(GLOB dbus_glib_binding_sources _dbus_glib_bindings/*.c) add_library(_dbus_glib_bindings SHARED ${dbus_glib_binding_sources}) -target_link_libraries(_dbus_glib_bindings ${PYTHON_LIBRARIES} ${DBUS_LIBRARY} ${DBUS_GLIB_LIBRARY} ${GLIB_LIBRARIES}) +target_link_libraries(_dbus_glib_bindings ${PYTHON_LIBRARIES} ${DBUS_LIBRARY} ${GLIB_LIBRARIES}) file(GLOB dbus_py_test_sources test/*.c) add_library(dbus_py_test SHARED ${dbus_py_test_sources}) diff --git a/_dbus_bindings/dbus_bindings-internal.h b/_dbus_bindings/dbus_bindings-internal.h index 4b831e8..e8490d6 100644 --- a/_dbus_bindings/dbus_bindings-internal.h +++ b/_dbus_bindings/dbus_bindings-internal.h @@ -41,6 +41,10 @@ # define USING_DBG 1 #endif +#ifdef _MSC_VER +# define inline __inline +#endif + #define DEFINE_CHECK(type) \ static inline int type##_Check (PyObject *o) \ { \ -- 1.7.10