[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60646] trunk/blender/extern/libmv: Libmv: move platform-specific defines into own file
Sergey Sharybin
sergey.vfx at gmail.com
Wed Oct 9 22:02:03 CEST 2013
Revision: 60646
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60646
Author: nazgul
Date: 2013-10-09 20:02:02 +0000 (Wed, 09 Oct 2013)
Log Message:
-----------
Libmv: move platform-specific defines into own file
Modified Paths:
--------------
trunk/blender/extern/libmv/CMakeLists.txt
trunk/blender/extern/libmv/bundle.sh
trunk/blender/extern/libmv/libmv-capi.cc
Added Paths:
-----------
trunk/blender/extern/libmv/libmv-capi_intern.h
Modified: trunk/blender/extern/libmv/CMakeLists.txt
===================================================================
--- trunk/blender/extern/libmv/CMakeLists.txt 2013-10-09 19:49:09 UTC (rev 60645)
+++ trunk/blender/extern/libmv/CMakeLists.txt 2013-10-09 20:02:02 UTC (rev 60646)
@@ -32,6 +32,7 @@
set(SRC
libmv-capi.h
+ libmv-capi_intern.h
)
if(WITH_LIBMV)
Modified: trunk/blender/extern/libmv/bundle.sh
===================================================================
--- trunk/blender/extern/libmv/bundle.sh 2013-10-09 19:49:09 UTC (rev 60645)
+++ trunk/blender/extern/libmv/bundle.sh 2013-10-09 20:02:02 UTC (rev 60646)
@@ -128,6 +128,7 @@
set(SRC
libmv-capi.h
+ libmv-capi_intern.h
)
if(WITH_LIBMV)
Modified: trunk/blender/extern/libmv/libmv-capi.cc
===================================================================
--- trunk/blender/extern/libmv/libmv-capi.cc 2013-10-09 19:49:09 UTC (rev 60645)
+++ trunk/blender/extern/libmv/libmv-capi.cc 2013-10-09 20:02:02 UTC (rev 60646)
@@ -43,35 +43,7 @@
# include <png.h>
#endif
-#if defined(_MSC_VER)
-# define __func__ __FUNCTION__
-#endif
-
-#ifdef WITH_LIBMV_GUARDED_ALLOC
-# include "MEM_guardedalloc.h"
-# define LIBMV_OBJECT_NEW OBJECT_GUARDED_NEW
-# define LIBMV_OBJECT_DELETE OBJECT_GUARDED_DELETE
-# define LIBMV_OBJECT_DELETE OBJECT_GUARDED_DELETE
-# define LIBMV_STRUCT_NEW(type, count) (type*)MEM_mallocN(sizeof(type) * count, __func__)
-# define LIBMV_STRUCT_DELETE(what) MEM_freeN(what)
-#else
-// Need this to keep libmv-capi potentially standalone.
-# if defined __GNUC__ || defined __sun
-# define LIBMV_OBJECT_NEW(type, args ...) \
- new(malloc(sizeof(type))) type(args)
-# else
-# define LIBMV_OBJECT_NEW(type, ...) \
- new(malloc(sizeof(type))) type(__VA_ARGS__)
-#endif
-# define LIBMV_OBJECT_DELETE(what, type) \
- { if(what) { \
- ((type*)(what))->~type(); \
- free(what); \
- } } (void)0
-# define LIBMV_STRUCT_NEW(type, count) (type*)malloc(sizeof(type) * count)
-# define LIBMV_STRUCT_DELETE(what) { if (what) free(what); } (void)0
-#endif
-
+#include "libmv-capi_intern.h"
#include "libmv/logging/logging.h"
#include "libmv/multiview/homography.h"
#include "libmv/tracking/track_region.h"
@@ -86,10 +58,6 @@
#include "libmv/simple_pipeline/reconstruction_scale.h"
#include "libmv/simple_pipeline/keyframe_selection.h"
-#ifdef _MSC_VER
-# define snprintf _snprintf
-#endif
-
struct libmv_Reconstruction {
libmv::EuclideanReconstruction reconstruction;
Added: trunk/blender/extern/libmv/libmv-capi_intern.h
===================================================================
--- trunk/blender/extern/libmv/libmv-capi_intern.h (rev 0)
+++ trunk/blender/extern/libmv/libmv-capi_intern.h 2013-10-09 20:02:02 UTC (rev 60646)
@@ -0,0 +1,59 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Sergey Sharybin
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef LIBMV_C_API_INTERN_H
+#define LIBMV_C_API_INTERN_H
+
+#if defined(_MSC_VER)
+# define __func__ __FUNCTION__
+# define snprintf _snprintf
+#endif
+
+#ifdef WITH_LIBMV_GUARDED_ALLOC
+# include "MEM_guardedalloc.h"
+# define LIBMV_OBJECT_NEW OBJECT_GUARDED_NEW
+# define LIBMV_OBJECT_DELETE OBJECT_GUARDED_DELETE
+# define LIBMV_OBJECT_DELETE OBJECT_GUARDED_DELETE
+# define LIBMV_STRUCT_NEW(type, count) (type*)MEM_mallocN(sizeof(type) * count, __func__)
+# define LIBMV_STRUCT_DELETE(what) MEM_freeN(what)
+#else
+// Need this to keep libmv-capi potentially standalone.
+# if defined __GNUC__ || defined __sun
+# define LIBMV_OBJECT_NEW(type, args ...) \
+ new(malloc(sizeof(type))) type(args)
+# else
+# define LIBMV_OBJECT_NEW(type, ...) \
+ new(malloc(sizeof(type))) type(__VA_ARGS__)
+#endif
+# define LIBMV_OBJECT_DELETE(what, type) \
+ { if(what) { \
+ ((type*)(what))->~type(); \
+ free(what); \
+ } } (void)0
+# define LIBMV_STRUCT_NEW(type, count) (type*)malloc(sizeof(type) * count)
+# define LIBMV_STRUCT_DELETE(what) { if (what) free(what); } (void)0
+#endif
+
+#endif // LIBMV_C_API_INTERN_H
More information about the Bf-blender-cvs
mailing list