[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53896] trunk/blender/source/creator/ creator.c: fix for building with BSD & MinGW.

Campbell Barton ideasman42 at gmail.com
Fri Jan 18 22:05:39 CET 2013


Revision: 53896
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53896
Author:   campbellbarton
Date:     2013-01-18 21:05:37 +0000 (Fri, 18 Jan 2013)
Log Message:
-----------
fix for building with BSD & MinGW.

Modified Paths:
--------------
    trunk/blender/source/creator/creator.c

Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c	2013-01-18 19:07:43 UTC (rev 53895)
+++ trunk/blender/source/creator/creator.c	2013-01-18 21:05:37 UTC (rev 53896)
@@ -53,10 +53,10 @@
 #endif
 
 /* for backtrace */
-#ifdef WIN32
+#if defined(__linux__) || defined(__APPLE__)
+#  include <execinfo.h>
+#elif defined(_MSV_VER)
 #  include <DbgHelp.h>
-#else
-#  include <execinfo.h>
 #endif
 
 #include <stdlib.h>
@@ -448,10 +448,12 @@
 	return 0;
 }
 
+#if defined(__linux__) || defined(__APPLE__)
+
+/* Unix */
 static void blender_crash_handler_backtrace(FILE *fp)
 {
 #define SIZE 100
-#ifndef WIN32
 	void *buffer[SIZE];
 	int nptrs;
 	char **strings;
@@ -468,10 +470,17 @@
 	}
 
 	free(strings);
-#else /* WIN32 */
+#undef SIZE
+}
+
+#elif defined(_MSV_VER)
+
+static void blender_crash_handler_backtrace(FILE *fp)
+{
 	(void)fp;
+
 #if 0
-	#define MAXSYMBOL 256
+#define MAXSYMBOL 256
 	unsigned short	i;
 	void *stack[SIZE];
 	unsigned short nframes;
@@ -496,10 +505,17 @@
 
 	MEM_freeN(symbolinfo);
 #endif
-#endif
-#undef SIZE
 }
 
+#else  /* non msvc/osx/linux */
+
+static void blender_crash_handler_backtrace(FILE *fp)
+{
+	(void)fp;
+}
+
+#endif
+
 static void blender_crash_handler(int signum)
 {
 




More information about the Bf-blender-cvs mailing list