[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52582] trunk/blender/source/blender/ blenlib: Fix #33226: error loading . blend files with different endian on Mac.

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Nov 26 21:37:05 CET 2012


Revision: 52582
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52582
Author:   blendix
Date:     2012-11-26 20:37:04 +0000 (Mon, 26 Nov 2012)
Log Message:
-----------
Fix #33226: error loading .blend files with different endian on Mac. The cause
was wrong inline and pure attributes on the endian switch function.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_endian_switch.h
    trunk/blender/source/blender/blenlib/BLI_rect.h
    trunk/blender/source/blender/blenlib/BLI_utildefines.h

Modified: trunk/blender/source/blender/blenlib/BLI_endian_switch.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_endian_switch.h	2012-11-26 19:50:08 UTC (rev 52581)
+++ trunk/blender/source/blender/blenlib/BLI_endian_switch.h	2012-11-26 20:37:04 UTC (rev 52582)
@@ -29,8 +29,7 @@
 
 #ifdef __GNUC__
 #  define ATTR_ENDIAN_SWITCH \
-	__attribute__((nonnull(1))) \
-	__attribute__((pure))
+	__attribute__((nonnull(1)))
 #else
 #  define ATTR_ENDIAN_SWITCH
 #endif

Modified: trunk/blender/source/blender/blenlib/BLI_rect.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_rect.h	2012-11-26 19:50:08 UTC (rev 52581)
+++ trunk/blender/source/blender/blenlib/BLI_rect.h	2012-11-26 20:37:04 UTC (rev 52582)
@@ -33,6 +33,9 @@
  *  \ingroup bli
  */
 
+#include "DNA_vec_types.h"
+#include "BLI_utildefines.h"
+
 struct rctf;
 struct rcti;
 
@@ -75,17 +78,6 @@
 void print_rctf(const char *str, const struct rctf *rect);
 void print_rcti(const char *str, const struct rcti *rect);
 
-/* hrmf, we need to work out this inline stuff */
-#if defined(_MSC_VER)
-#  define BLI_INLINE static __forceinline
-#elif defined(__GNUC__)
-#  define BLI_INLINE static inline __attribute((always_inline))
-#else
-/* #warning "MSC/GNUC defines not found, inline non-functional" */
-#  define BLI_INLINE static
-#endif
-
-#include "DNA_vec_types.h"
 BLI_INLINE float BLI_rcti_cent_x_fl(const struct rcti *rct) { return (float)(rct->xmin + rct->xmax) / 2.0f; }
 BLI_INLINE float BLI_rcti_cent_y_fl(const struct rcti *rct) { return (float)(rct->ymin + rct->ymax) / 2.0f; }
 BLI_INLINE int   BLI_rcti_cent_x(const struct rcti *rct) { return (rct->xmin + rct->xmax) / 2; }

Modified: trunk/blender/source/blender/blenlib/BLI_utildefines.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_utildefines.h	2012-11-26 19:50:08 UTC (rev 52581)
+++ trunk/blender/source/blender/blenlib/BLI_utildefines.h	2012-11-26 20:37:04 UTC (rev 52582)
@@ -324,11 +324,13 @@
 /*little macro so inline keyword works*/
 #if defined(_MSC_VER)
 #  define BLI_INLINE static __forceinline
-#elif defined(__GNUC__)
-#  define BLI_INLINE static inline __attribute((always_inline))
 #else
-/* #warning "MSC/GNUC defines not found, inline non-functional" */
-#  define BLI_INLINE static
+#  if (defined(__APPLE__) && defined(__ppc__))
+/* static inline __attribute__ here breaks osx ppc gcc42 build */
+#    define BLI_INLINE static __attribute__((always_inline))
+#  else
+#    define BLI_INLINE static inline __attribute__((always_inline))
+#  endif
 #endif
 
 




More information about the Bf-blender-cvs mailing list