]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Solve problem of using MIN/MAX macros on windows.
authorana <ana@opencascade.com>
Thu, 20 Sep 2012 11:07:08 +0000 (11:07 +0000)
committerana <ana@opencascade.com>
Thu, 20 Sep 2012 11:07:08 +0000 (11:07 +0000)
src/INTERP_KERNEL/InterpolationUtils.hxx
src/MEDCoupling/MEDCouplingTimeDiscretization.hxx
src/MEDOP/cmp/CMakeLists.txt

index 322042e73be5b72c52b393d74cc278a9228967d0..80cdb8d72986e63f90463af5cbcdfa656f9284f2 100644 (file)
 #include <iostream>
 #include <limits>
 
-#ifdef WIN32
-  #ifdef min
-    #undef min
-  #endif
-#endif
-
 namespace INTERP_KERNEL
 {
   template<class ConnType, NumberingPolicy numPol>
index a16a117d3f62745adfb8e33518253e85d140a8c7..79d6fa07a6bdde63e6ffb6b69e89b2dea8378f23 100644 (file)
 
 #include <vector>
 
-#ifdef WIN32\r
-  #ifdef max\r
-    #undef max\r
-  #endif\r
-\r
-  #ifdef min\r
-    #undef min\r
-  #endif\r
-#endif\r
-
 namespace ParaMEDMEM
 {
   class DataArrayDouble;
index 7d5cc811be1bd8606dac2918db8fca6c4a534e72..165ca2d82e844cedcaad6c8f36d56464dd5a9ee7 100644 (file)
@@ -55,9 +55,14 @@ SET(COMMON_LIBS
   ${OMNIORB_LIBS}
   ${PLATFORM_LIBS}
 )
+SET(COMMON_FLAGS "${HDF5_DEFINITIONS} ${MED3_DEFINITIONS} ${PLATFORM_DEFINITIONS} ${OMNIORB_DEFINITIONS}")
+# This undefines the macros MIN and MAX which are specified in the windows headers 
+IF(WINDOWS)
+  SET(COMMON_FLAGS "${COMMON_FLAGS} -DNOMINMAX")
+ENDIF(WINDOWS)
 
 ADD_LIBRARY(MEDOPFactoryEngine SHARED ${MEDOPFactoryEngine_SOURCES})
-SET_TARGET_PROPERTIES(MEDOPFactoryEngine PROPERTIES COMPILE_FLAGS "${HDF5_DEFINITIONS} ${MED3_DEFINITIONS} ${PLATFORM_DEFINITIONS} ${OMNIORB_DEFINITIONS}")
+SET_TARGET_PROPERTIES(MEDOPFactoryEngine PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
 TARGET_LINK_LIBRARIES(MEDOPFactoryEngine SalomeIDLMED ${COMMON_LIBS})
 
 INSTALL(TARGETS MEDOPFactoryEngine DESTINATION ${MED_salomelib_LIBS})