#ifndef SOFAPYTHON_PYTHON_H
#define SOFAPYTHON_PYTHON_H


// This header simply includes Python.h, taking care of platform-specific stuff

// It should be included before any standard headers:
// "Since Python may define some pre-processor definitions which affect the
// standard headers on some systems, you must include Python.h before any
// standard headers are included."

#if defined(_WIN32)
#	define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h
#	define Py_ENABLE_SHARED 1 // this flag ensure to use dll's version (needed because of MS_NO_COREDLL define).
#endif

#if defined(_MSC_VER) && defined(_DEBUG)
// if you use Python on windows in debug build, be sure to provide a compiled version because
// installation package doesn't come with debug libs.
#    include <Python.h> 
#elif defined(__APPLE__) && defined(__MACH__)
#    include <Python/Python.h>
#else
#    include <Python.h>
#endif


#endif

#ifndef SOFAPYTHON_PYTHON_H
#define SOFAPYTHON_PYTHON_H


// This header simply includes Python.h, taking care of platform-specific stuff

// It should be included before any standard headers:
// "Since Python may define some pre-processor definitions which affect the
// standard headers on some systems, you must include Python.h before any
// standard headers are included."

#if defined(_WIN32)
#	define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h
#endif

#if defined(_MSC_VER) && defined(_DEBUG)
// undefine _DEBUG since we want to always link agains the release version of
// python and pyconfig.h automatically links debug version if _DEBUG is defined.
// ocarre: no we don't, in debug on Windows we cannot link with python release, if we want to build SofaPython in debug we have to compile python in debug
//#    undef _DEBUG
#    include <Python.h>
//#    define _DEBUG
#elif defined(__APPLE__) && defined(__MACH__)
#    include <Python/Python.h>
#else
#    include <Python.h>
#endif


#endif

--- 
+++ 
@@ -11,15 +11,13 @@
 
 #if defined(_WIN32)
 #	define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h
+#	define Py_ENABLE_SHARED 1 // this flag ensure to use dll's version (needed because of MS_NO_COREDLL define).
 #endif
 
 #if defined(_MSC_VER) && defined(_DEBUG)
-// undefine _DEBUG since we want to always link agains the release version of
-// python and pyconfig.h automatically links debug version if _DEBUG is defined.
-// ocarre: no we don't, in debug on Windows we cannot link with python release, if we want to build SofaPython in debug we have to compile python in debug
-//#    undef _DEBUG
-#    include <Python.h>
-//#    define _DEBUG
+// if you use Python on windows in debug build, be sure to provide a compiled version because
+// installation package doesn't come with debug libs.
+#    include <Python.h> 
 #elif defined(__APPLE__) && defined(__MACH__)
 #    include <Python/Python.h>
 #else
Fix python link in release build.


Former-commit-id: f2b0e4ff65df702ae4f98bed2a39dcfdc0f7e9c4