Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make FCollada compile on OpenBSD, based on patch by anthonyjbentley. …

…Refs #1463.

git-svn-id: http://svn.wildfiregames.com/public/ps/trunk@11936 3db68df2-c116-0410-a063-a993310a9797
  • Loading branch information...
commit 13ab1283df5522eccfc83e99954927c705a470b7 1 parent 31dcbb5
leper authored
18 build/workspaces/clean-workspaces.sh
View
@@ -1,13 +1,15 @@
#!/bin/sh
-# FreeBSD's make is different than GNU make, so we allow overriding the make command.
-# If not set, MAKE will default to "gmake" on FreeBSD, or "make" on other OSes
-if [ "`uname -s`" = "FreeBSD" ]
-then
- MAKE=${MAKE:="gmake"}
-else
- MAKE=${MAKE:="make"}
-fi
+# Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
+# is not set.
+case "`uname -s`" in
+ "FreeBSD" | "OpenBSD" )
+ MAKE=${MAKE:="gmake"}
+ ;;
+ * )
+ MAKE=${MAKE:="make"}
+ ;;
+esac
# (We don't attempt to clean up every last file here - output in
# binaries/system/ will still be there, etc. This is mostly just
18 build/workspaces/update-workspaces.sh
View
@@ -18,14 +18,16 @@ esac
JOBS=${JOBS:="-j2"}
-# FreeBSD's make is different than GNU make, so we allow overriding the make command.
-# If not set, MAKE will default to "gmake" on FreeBSD, or "make" on other OSes
-if [ "`uname -s`" = "FreeBSD" ]
-then
- MAKE=${MAKE:="gmake"}
-else
- MAKE=${MAKE:="make"}
-fi
+# Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
+# is not set.
+case "`uname -s`" in
+ "FreeBSD" | "OpenBSD" )
+ MAKE=${MAKE:="gmake"}
+ ;;
+ * )
+ MAKE=${MAKE:="make"}
+ ;;
+esac
# Parse command-line options:
2  libraries/fcollada/include/FCDocument/FCDocument.h
View
@@ -30,7 +30,7 @@
#if defined(WIN32)
template <class T> class FCOLLADA_EXPORT FCDLibrary; /**< Trick Doxygen. */
template <class T> class FCOLLADA_EXPORT FUUniqueStringMapT; /**< Trick Doxygen. */
-#elif defined(LINUX) || defined(__APPLE__) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
+#elif defined(LINUX) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
template <class T> class FCDLibrary; /**< Trick Doxygen. */
template <class T> class FUUniqueStringMapT; /**< Trick Doxygen. */
#endif // LINUX
4 libraries/fcollada/include/FUtils/FUCriticalSection.h
View
@@ -30,10 +30,10 @@ class FCOLLADA_EXPORT FUCriticalSection
private:
#ifdef WIN32
CRITICAL_SECTION criticalSection; // WIN32
-#elif defined (__APPLE__)
+#elif defined(__APPLE__)
//Do something here.
MPCriticalRegionID criticalSection;
-#elif defined (LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
#else
#warning "FUCriticalSection: Critical section not implemented for other platforms."
#endif
22 libraries/fcollada/include/FUtils/Platforms.h
View
@@ -65,16 +65,16 @@
#include <windows.h>
#include <stdio.h>
#include <wchar.h>
-#else
-#ifdef __APPLE__
+
+#elif defined(__APPLE__)
#include <ctype.h>
#include <wctype.h>
#include <unistd.h>
#include <string.h>
#include <wchar.h>
#include <stdint.h>
-#else // __APPLE__
-#if defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+
+#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
#include <ctype.h>
#include <wctype.h>
#include <unistd.h>
@@ -82,19 +82,17 @@
#include <wchar.h>
#include <stdarg.h>
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
#include <malloc.h>
-#endif // __FreeBSD__
+#endif // !__FreeBSD__ && !__OpenBSD__
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
+
#else // OTHER...
#error "Unsupported platform."
-#endif // LINUX || __PPU__
-#endif // __APPLE__
-
-#endif // WIN32
+#endif
// Cross-platform type definitions
#ifdef WIN32
@@ -127,7 +125,7 @@ typedef uint8_t byte;
#endif // PLATFORMS
// Important functions that some OSes have missing!
-#if defined(__APPLE__) || defined (LINUX) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__APPLE__) || defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
inline char* strlower(char* str) { char* it = str; while (*it != 0) { *it = tolower(*it); ++it; } return str; }
inline wchar_t* wcslwr(wchar_t* str) { wchar_t* it = str; while (*it != 0) { *it = towlower(*it); ++it; } return str; }
inline int wcsicmp(const wchar_t* s1, const wchar_t* s2) { wchar_t c1 = *s1, c2 = *s2; while (c1 != 0 && c2 != 0) { if (c1 >= 'a' && c1 <= 'z') c1 -= 'a' + 'A'; if (c2 >= 'a' && c2 <= 'z') c2 -= 'a' + 'A'; if (c2 < c1) return -1; else if (c2 > c1) return 1; c1 = *(++s1); c2 = *(++s2); } return 0; }
@@ -141,7 +139,7 @@ inline int wcsicmp(const wchar_t* s1, const wchar_t* s2) { wchar_t c1 = *s1, c2
#elif defined(__PPU__)
#define glClearDepth glClearDepthf
-#endif // __APPLE__ and LINUX
+#endif // __APPLE__ || LINUX || _FreeBSD__ || __FreeBSD_kernel__ || __OpenBSD__
// Cross-platform needed functions
#ifdef WIN32
2  libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameter.cpp
View
@@ -215,4 +215,4 @@ extern void TrickLinkerEffectParameter()
TrickLinkerEffectParameterAnimatableT<FMVector3, FUParameterQualifiers::VECTOR>();
TrickLinkerEffectParameterAnimatableT<FMVector3, FUParameterQualifiers::COLOR>();
TrickLinkerEffectParameterAnimatableT<FMMatrix44, FUParameterQualifiers::SIMPLE>();
-}
+}
2  libraries/fcollada/src/FCollada/FCDocument/FCDGeometryPolygonsTools.cpp
View
@@ -1196,4 +1196,4 @@ namespace FCDGeometryPolygonsTools
}
}
-}
+}
2  libraries/fcollada/src/FCollada/FCDocument/FCDocument.h
View
@@ -30,7 +30,7 @@
#if defined(WIN32)
template <class T> class FCOLLADA_EXPORT FCDLibrary; /**< Trick Doxygen. */
template <class T> class FCOLLADA_EXPORT FUUniqueStringMapT; /**< Trick Doxygen. */
-#elif defined(LINUX) || defined(__APPLE__) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
+#elif defined(LINUX) || defined(__APPLE__) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
template <class T> class FCDLibrary; /**< Trick Doxygen. */
template <class T> class FUUniqueStringMapT; /**< Trick Doxygen. */
#endif // LINUX
4 libraries/fcollada/src/FCollada/FUtils/FUCriticalSection.h
View
@@ -30,10 +30,10 @@ class FCOLLADA_EXPORT FUCriticalSection
private:
#ifdef WIN32
CRITICAL_SECTION criticalSection; // WIN32
-#elif defined (__APPLE__)
+#elif defined(__APPLE__)
//Do something here.
MPCriticalRegionID criticalSection;
-#elif defined (LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
#else
#warning "FUCriticalSection: Critical section not implemented for other platforms."
#endif
2  libraries/fcollada/src/FCollada/FUtils/FUStringBuilder.h
View
@@ -135,7 +135,7 @@ class FCOLLADA_EXPORT FUStringBuilderT
#else
inline void append(unsigned int i) { append((uint32) i); } /**< See above. */
#endif
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__OpenBSD__)
inline void append(size_t i) { append((uint64)i); }
#endif // defined(WIN32)
20 libraries/fcollada/src/FCollada/FUtils/Platforms.h
View
@@ -65,16 +65,16 @@
#include <windows.h>
#include <stdio.h>
#include <wchar.h>
-#else
-#ifdef __APPLE__
+
+#elif defined(__APPLE__)
#include <ctype.h>
#include <wctype.h>
#include <unistd.h>
#include <string.h>
#include <wchar.h>
#include <stdint.h>
-#else // __APPLE__
-#if defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+
+#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
#include <ctype.h>
#include <wctype.h>
#include <unistd.h>
@@ -82,19 +82,17 @@
#include <wchar.h>
#include <stdarg.h>
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
#include <malloc.h>
-#endif // __FreeBSD__
+#endif // !__FreeBSD__ && !__OpenBSD__
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
+
#else // OTHER...
#error "Unsupported platform."
-#endif // LINUX || __PPU__
-#endif // __APPLE__
-
-#endif // WIN32
+#endif
// Cross-platform type definitions
#ifdef WIN32
@@ -127,7 +125,7 @@ typedef uint8_t byte;
#endif // PLATFORMS
// Important functions that some OSes have missing!
-#if defined(__APPLE__) || defined (LINUX) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
+#if defined(__APPLE__) || defined (LINUX) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
inline char* strlower(char* str) { char* it = str; while (*it != 0) { *it = tolower(*it); ++it; } return str; }
inline wchar_t* wcslwr(wchar_t* str) { wchar_t* it = str; while (*it != 0) { *it = towlower(*it); ++it; } return str; }
inline int wcsicmp(const wchar_t* s1, const wchar_t* s2) { wchar_t c1 = *s1, c2 = *s2; while (c1 != 0 && c2 != 0) { if (c1 >= 'a' && c1 <= 'z') c1 -= 'a' + 'A'; if (c2 >= 'a' && c2 <= 'z') c2 -= 'a' + 'A'; if (c2 < c1) return -1; else if (c2 > c1) return 1; c1 = *(++s1); c2 = *(++s2); } return 0; }
Please sign in to comment.
Something went wrong with that request. Please try again.