[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43297] branches/carve_booleans: Care booleans: fix for compilation with msvc
Sergey Sharybin
sergey.vfx at gmail.com
Wed Jan 11 15:43:47 CET 2012
Revision: 43297
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43297
Author: nazgul
Date: 2012-01-11 14:43:46 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
Care booleans: fix for compilation with msvc
Modified Paths:
--------------
branches/carve_booleans/build_files/scons/tools/btools.py
branches/carve_booleans/extern/carve/CMakeLists.txt
branches/carve_booleans/extern/carve/SConscript
branches/carve_booleans/extern/carve/bundle.sh
branches/carve_booleans/extern/carve/include/carve/config.h
branches/carve_booleans/extern/carve/include/carve/win32.h
branches/carve_booleans/extern/carve/patches/files/config.h
branches/carve_booleans/extern/carve/patches/series
Added Paths:
-----------
branches/carve_booleans/extern/carve/patches/msvc.patch
branches/carve_booleans/extern/carve/patches/win32.patch
Modified: branches/carve_booleans/build_files/scons/tools/btools.py
===================================================================
--- branches/carve_booleans/build_files/scons/tools/btools.py 2012-01-11 14:43:34 UTC (rev 43296)
+++ branches/carve_booleans/build_files/scons/tools/btools.py 2012-01-11 14:43:46 UTC (rev 43297)
@@ -161,7 +161,7 @@
'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES' 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE',
'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
- 'WITH_BF_LIBMV'
+ 'WITH_BF_LIBMV', 'WITH_BF_CARVE'
]
# Have options here that scons expects to be lists
Modified: branches/carve_booleans/extern/carve/CMakeLists.txt
===================================================================
--- branches/carve_booleans/extern/carve/CMakeLists.txt 2012-01-11 14:43:34 UTC (rev 43296)
+++ branches/carve_booleans/extern/carve/CMakeLists.txt 2012-01-11 14:43:46 UTC (rev 43297)
@@ -148,10 +148,17 @@
if(WITH_BOOST)
add_definitions(
- -DHAVE_BOOST_UNORDERED_COLLECTIONS
-DCARVE_SYSTEM_BOOST
)
+ if(NOT MSVC)
+ # Boost is setting as preferred collections library in the Carve code
+ add_definitions(
+ -DHAVE_BOOST_UNORDERED_COLLECTIONS
+ )
+ endif()
+
+
list(APPEND INC
${BOOST_INCLUDE_DIR}
)
Modified: branches/carve_booleans/extern/carve/SConscript
===================================================================
--- branches/carve_booleans/extern/carve/SConscript 2012-01-11 14:43:34 UTC (rev 43296)
+++ branches/carve_booleans/extern/carve/SConscript 2012-01-11 14:43:46 UTC (rev 43297)
@@ -12,7 +12,10 @@
incs = ['include']
if env['WITH_BF_BOOST']:
- defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
+ if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
+ # Boost is setting as preferred collections library in the Carve code
+ defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
+
defs.append('CARVE_SYSTEM_BOOST')
incs.append(env['BF_BOOST_INC'])
Modified: branches/carve_booleans/extern/carve/bundle.sh
===================================================================
--- branches/carve_booleans/extern/carve/bundle.sh 2012-01-11 14:43:34 UTC (rev 43296)
+++ branches/carve_booleans/extern/carve/bundle.sh 2012-01-11 14:43:46 UTC (rev 43297)
@@ -79,10 +79,16 @@
if(WITH_BOOST)
add_definitions(
- -DHAVE_BOOST_UNORDERED_COLLECTIONS
-DCARVE_SYSTEM_BOOST
)
+ if(NOT MSVC)
+ # Boost is setting as preferred collections library in the Carve code
+ add_definitions(
+ -DHAVE_BOOST_UNORDERED_COLLECTIONS
+ )
+ endif()
+
list(APPEND INC
\${BOOST_INCLUDE_DIR}
)
@@ -106,7 +112,10 @@
incs = ['include']
if env['WITH_BF_BOOST']:
- defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
+ if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
+ # Boost is setting as preferred collections library in the Carve code
+ defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
+
defs.append('CARVE_SYSTEM_BOOST')
incs.append(env['BF_BOOST_INC'])
Modified: branches/carve_booleans/extern/carve/include/carve/config.h
===================================================================
--- branches/carve_booleans/extern/carve/include/carve/config.h 2012-01-11 14:43:34 UTC (rev 43296)
+++ branches/carve_booleans/extern/carve/include/carve/config.h 2012-01-11 14:43:46 UTC (rev 43297)
@@ -9,8 +9,4 @@
# endif
# define HAVE_STDINT_H
-#elif defined(_MSC_VER)
-# if !defined(HAVE_BOOST_UNORDERED_COLLECTIONS)
-# define HAVE_BOOST_UNORDERED_COLLECTIONS
-# endif
#endif
Modified: branches/carve_booleans/extern/carve/include/carve/win32.h
===================================================================
--- branches/carve_booleans/extern/carve/include/carve/win32.h 2012-01-11 14:43:34 UTC (rev 43296)
+++ branches/carve_booleans/extern/carve/include/carve/win32.h 2012-01-11 14:43:46 UTC (rev 43297)
@@ -5,14 +5,20 @@
#pragma warning (disable : 4996)
#pragma warning (disable : 4786)
-typedef char int8_t;
-typedef short int16_t;
-typedef long int32_t;
+#if defined(_WIN32) && !defined(FREE_WINDOWS)
+/* The __intXX are built-in types of the visual complier! So we don't
+ need to include anything else here.
+ Thistypedefs should be in sync with types from MEM_sys_types.h */
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned long uint32_t;
+typedef signed __int8 int8_t;
+typedef signed __int16 int16_t;
+typedef signed __int32 int32_t;
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+#endif
+
#include <string.h>
#include <stdlib.h>
Modified: branches/carve_booleans/extern/carve/patches/files/config.h
===================================================================
--- branches/carve_booleans/extern/carve/patches/files/config.h 2012-01-11 14:43:34 UTC (rev 43296)
+++ branches/carve_booleans/extern/carve/patches/files/config.h 2012-01-11 14:43:46 UTC (rev 43297)
@@ -9,8 +9,4 @@
# endif
# define HAVE_STDINT_H
-#elif defined(_MSC_VER)
-# if !defined(HAVE_BOOST_UNORDERED_COLLECTIONS)
-# define HAVE_BOOST_UNORDERED_COLLECTIONS
-# endif
#endif
Added: branches/carve_booleans/extern/carve/patches/msvc.patch
===================================================================
--- branches/carve_booleans/extern/carve/patches/msvc.patch (rev 0)
+++ branches/carve_booleans/extern/carve/patches/msvc.patch 2012-01-11 14:43:46 UTC (rev 43297)
@@ -0,0 +1,12 @@
+diff -r c8cbec41cd35 lib/mesh.cpp
+--- a/lib/mesh.cpp Thu Dec 01 15:51:44 2011 -0500
++++ b/lib/mesh.cpp Wed Jan 11 20:37:29 2012 +0600
+@@ -207,7 +207,7 @@
+
+
+ template<unsigned ndim>
+- Face<ndim> *Face<ndim>::closeLoop(Face<ndim>::edge_t *start) {
++ Face<ndim> *Face<ndim>::closeLoop(typename Face<ndim>::edge_t *start) {
+ edge_t *e = start;
+ std::vector<edge_t *> loop_edges;
+ do {
Modified: branches/carve_booleans/extern/carve/patches/series
===================================================================
--- branches/carve_booleans/extern/carve/patches/series 2012-01-11 14:43:34 UTC (rev 43296)
+++ branches/carve_booleans/extern/carve/patches/series 2012-01-11 14:43:46 UTC (rev 43297)
@@ -1,2 +1,4 @@
strict_flags.patch
includes.patch
+win32.patch
+msvc.patch
Added: branches/carve_booleans/extern/carve/patches/win32.patch
===================================================================
--- branches/carve_booleans/extern/carve/patches/win32.patch (rev 0)
+++ branches/carve_booleans/extern/carve/patches/win32.patch 2012-01-11 14:43:46 UTC (rev 43297)
@@ -0,0 +1,31 @@
+diff -r c8cbec41cd35 include/carve/win32.h
+--- a/include/carve/win32.h Thu Dec 01 15:51:44 2011 -0500
++++ b/include/carve/win32.h Wed Jan 11 20:05:28 2012 +0600
+@@ -5,13 +5,21 @@
+ #pragma warning (disable : 4996)
+ #pragma warning (disable : 4786)
+
+-typedef char int8_t;
+-typedef short int16_t;
+-typedef long int32_t;
++#if defined(_WIN32) && !defined(__MINGW32__)
+
+-typedef unsigned char uint8_t;
+-typedef unsigned short uint16_t;
+-typedef unsigned long uint32_t;
++/* The __intXX are built-in types of the visual complier! So we don't
++ need to include anything else here.
++ This typedefs should be in sync with types from MEM_sys_types.h */
++
++typedef signed __int8 int8_t;
++typedef signed __int16 int16_t;
++typedef signed __int32 int32_t;
++
++typedef unsigned __int8 uint8_t;
++typedef unsigned __int16 uint16_t;
++typedef unsigned __int32 uint32_t;
++
++#endif
+
+ #include <string.h>
+ #include <stdlib.h>
More information about the Bf-blender-cvs
mailing list