Fix compile problem in MSVC after Win64 patch
authorBenoit Bolsee <benoit.bolsee@online.be>
Sun, 17 Aug 2008 22:28:30 +0000 (22:28 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Sun, 17 Aug 2008 22:28:30 +0000 (22:28 +0000)
intern/guardedalloc/BLO_sys_types.h
intern/opennl/superlu/BLO_sys_types.h
source/blender/imbuf/intern/cineon/logImageCore.h
source/blender/src/buttons_scene.c

index 17fa99308e06b20aa4dea0aab25bb388b1b41e1d..4d3ffbe023dd7421a3c78db6b6d6adb32bb9b0f0 100644 (file)
@@ -69,13 +69,23 @@ typedef unsigned __int16 uint16_t;
 typedef unsigned __int32 uint32_t;
 typedef unsigned __int64 uint64_t;
 
+#ifndef _INTPTR_T_DEFINED
 #ifdef _WIN64
 typedef __int64 intptr_t;
-typedef unsigned __int64 uintptr_t;
 #else
 typedef long intptr_t;
+#endif
+#define _INTPTR_T_DEFINED
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#ifdef _WIN64
+typedef unsigned __int64 uintptr_t;
+#else
 typedef unsigned long uintptr_t;
 #endif
+#define _UINTPTR_T_DEFINED
+#endif
 
 #elif defined(__linux__)
 
@@ -94,8 +104,12 @@ typedef unsigned long uintptr_t;
 #endif /* ifdef platform for types */
 
 #ifdef _WIN32
+#ifndef htonl
 #define htonl(x) correctByteOrder(x)
+#endif
+#ifndef ntohl
 #define ntohl(x) correctByteOrder(x)
+#endif
 #elif defined (__FreeBSD__) || defined (__OpenBSD__) 
 #include <sys/param.h>
 #elif defined (__APPLE__)
index 17fa99308e06b20aa4dea0aab25bb388b1b41e1d..4d3ffbe023dd7421a3c78db6b6d6adb32bb9b0f0 100644 (file)
@@ -69,13 +69,23 @@ typedef unsigned __int16 uint16_t;
 typedef unsigned __int32 uint32_t;
 typedef unsigned __int64 uint64_t;
 
+#ifndef _INTPTR_T_DEFINED
 #ifdef _WIN64
 typedef __int64 intptr_t;
-typedef unsigned __int64 uintptr_t;
 #else
 typedef long intptr_t;
+#endif
+#define _INTPTR_T_DEFINED
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#ifdef _WIN64
+typedef unsigned __int64 uintptr_t;
+#else
 typedef unsigned long uintptr_t;
 #endif
+#define _UINTPTR_T_DEFINED
+#endif
 
 #elif defined(__linux__)
 
@@ -94,8 +104,12 @@ typedef unsigned long uintptr_t;
 #endif /* ifdef platform for types */
 
 #ifdef _WIN32
+#ifndef htonl
 #define htonl(x) correctByteOrder(x)
+#endif
+#ifndef ntohl
 #define ntohl(x) correctByteOrder(x)
+#endif
 #elif defined (__FreeBSD__) || defined (__OpenBSD__) 
 #include <sys/param.h>
 #elif defined (__APPLE__)
index 9b62b36891548aadbef829177622faa00c9100e6..2646e8b3c12c979b9815fc50c7e9de1c88fa2cac 100644 (file)
@@ -35,7 +35,8 @@ extern "C" {
 #endif
 
 #include "BLO_sys_types.h" // for intptr_t support
-
+#undef ntohl
+#undef htonl
 typedef int (GetRowFn)(LogImageFile* logImage, unsigned short* row, int lineNum);
 typedef int (SetRowFn)(LogImageFile* logImage, const unsigned short* row, int lineNum);
 typedef void (CloseFn)(LogImageFile* logImage);
index dd0a904ab4f270c4d129aed82c008b72b2e3e0ea..5205be3e1b0dba4e79924dc3682806201c39da88 100644 (file)
@@ -33,6 +33,7 @@
 #include <string.h>
 
 #include "MEM_guardedalloc.h"
+#include "BLO_sys_types.h" // for intptr_t support
 #include "DNA_node_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_space_types.h"