Index: build/premake/extern_libs4.lua
===================================================================
--- build/premake/extern_libs4.lua	(revision 11995)
+++ build/premake/extern_libs4.lua	(working copy)
@@ -361,7 +361,7 @@
 				add_default_include_paths("libpng")
 			end
 			if os.getversion().description == "OpenBSD" then
-				includedirs { "/usr/local/include/libpng" }
+				pkgconfig_cflags("libpng")
 			end
 		end,
 		link_settings = function()
@@ -549,10 +549,7 @@
 			-- TODO: We need to force linking with these as currently
 			-- they need to be loaded explicitly on execution
 			if os.getversion().description == "OpenBSD" then
-				add_default_links({
-					unix_names = { "ogg",
-						"vorbis" },
-				})
+				pkgconfig_libs("vorbisfile")
 			end
 			add_default_links({
 				win_names  = { "vorbisfile" },
Index: build/premake/premake4.lua
===================================================================
--- build/premake/premake4.lua	(revision 11995)
+++ build/premake/premake4.lua	(working copy)
@@ -999,9 +999,7 @@
 		-- required to use WinMain() on Windows, otherwise will default to main()
 		flags { "WinMain" }
 
-	elseif os.is("linux") then
-		defines { "LINUX" }
-
+	elseif os.is("linux") or os.getversion().description == "GNU/kFreeBSD" then
 		links {
 			"dl",
 		}
@@ -1024,8 +1022,6 @@
 		linkoptions { "-rdynamic" }
 
 	elseif os.is("macosx") then
-		-- define MACOS-something?
-
 		-- install_name settings aren't really supported yet by premake, but there are plans for the future.
 		-- we currently use this hack to work around some bugs with wrong install_names.
 		if target_type == "SharedLib" then
Index: libraries/fcollada/include/FMath/FMArrayPointer.h
===================================================================
--- libraries/fcollada/include/FMath/FMArrayPointer.h	(revision 11995)
+++ libraries/fcollada/include/FMath/FMArrayPointer.h	(working copy)
@@ -15,9 +15,7 @@
 #ifndef _FM_ARRAY_POINTER_H_
 #define _FM_ARRAY_POINTER_H_
 
-#ifndef _FM_ARRAY_H_
 #include "FMath/FMArray.h"
-#endif // _FM_ARRAY_H_
 
 // Already documented in FMArray.h.
 namespace fm
Index: libraries/fcollada/include/FMath/FMTree.h
===================================================================
--- libraries/fcollada/include/FMath/FMTree.h	(revision 11995)
+++ libraries/fcollada/include/FMath/FMTree.h	(working copy)
@@ -14,9 +14,7 @@
 #ifndef _FM_TREE_H_
 #define _FM_TREE_H_
 
-#ifndef _FM_ALLOCATOR_H_
 #include "FMath/FMAllocator.h"
-#endif // _FM_ALLOCATOR_H_
 
 namespace fm
 {
Index: libraries/fcollada/include/FMath/FMFloat.h
===================================================================
--- libraries/fcollada/include/FMath/FMFloat.h	(revision 11995)
+++ libraries/fcollada/include/FMath/FMFloat.h	(working copy)
@@ -14,7 +14,7 @@
 #ifndef _FM_FLOAT_H_
 #define _FM_FLOAT_H_
 
-#if !defined(_INC_FLOAT) && (defined (WIN32) || defined (LINUX) || defined(__APPLE__))
+#if !defined(_INC_FLOAT) && (defined (WIN32) || defined (__linux__) || defined(__APPLE__))
 #include <float.h>
 #endif // _INC_FLOAT, WIN32 and LINUX
 
Index: libraries/fcollada/include/FMath/FMArray.h
===================================================================
--- libraries/fcollada/include/FMath/FMArray.h	(revision 11995)
+++ libraries/fcollada/include/FMath/FMArray.h	(working copy)
@@ -14,12 +14,8 @@
 #ifndef _FM_ARRAY_H_
 #define _FM_ARRAY_H_
 
-#ifndef _FM_ALLOCATOR_H_
 #include "FMath/FMAllocator.h"
-#endif // _FM_ALLOCATOR_H_
-#ifndef _FM_SORT_H_
 #include "FMath/FMSort.h"
-#endif // _FM_SORT_H_
 
 #ifdef WIN32
 #pragma warning(disable:4127)
Index: libraries/fcollada/include/FUtils/Platforms.h
===================================================================
--- libraries/fcollada/include/FUtils/Platforms.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/Platforms.h	(working copy)
@@ -27,7 +27,7 @@
 #define FCOLLADA_EXPORT __declspec(dllimport)
 #define FCOLLADA_LOCAL
 #endif // FCOLLADA_INTERNAL
-#elif defined(__APPLE__) || defined(LINUX)
+#elif defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #define FCOLLADA_EXPORT __attribute__((visibility("default")))
 #define FCOLLADA_LOCAL __attribute__((visibility("hidden")))
 #endif
@@ -74,7 +74,7 @@
 #include <wchar.h>
 #include <stdint.h>
 
-#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+#elif defined(__linux__) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include <ctype.h>
 #include <wctype.h>
 #include <unistd.h>
@@ -125,7 +125,7 @@
 #endif // PLATFORMS
 
 // Important functions that some OSes have missing!
-#if defined(__APPLE__) || defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+#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; }
@@ -139,7 +139,7 @@
 #elif defined(__PPU__)
 #define glClearDepth glClearDepthf
 
-#endif // __APPLE__ || LINUX || _FreeBSD__ || __FreeBSD_kernel__ || __OpenBSD__
+#endif // __APPLE__ || __linux__ || __FreeBSD__ || __FreeBSD_kernel__ || __OpenBSD__
 
 // Cross-platform needed functions
 #ifdef WIN32
Index: libraries/fcollada/include/FUtils/FUStringBuilder.h
===================================================================
--- libraries/fcollada/include/FUtils/FUStringBuilder.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/FUStringBuilder.h	(working copy)
@@ -135,6 +135,8 @@
 #else
 	inline void append(unsigned int i) { append((uint32) i); } /**< See above. */
 #endif
+#elif defined(__APPLE__) || defined(__OpenBSD__)
+	inline void append(size_t i) { append((uint64)i); }
 #endif // defined(WIN32)
 
 	/** Appends the floating-point value, after converting it to a string,
Index: libraries/fcollada/include/FUtils/FUEvent.h
===================================================================
--- libraries/fcollada/include/FUtils/FUEvent.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/FUEvent.h	(working copy)
@@ -18,9 +18,7 @@
 #ifndef _FU_EVENT_H_
 #define _FU_EVENT_H_
 
-#ifndef _FU_FUNCTOR_H_
 #include "FUtils/FUFunctor.h"
-#endif // _FU_FUNCTOR_H_
 
 /**
 	An event with no argument.
Index: libraries/fcollada/include/FUtils/FUFileManager.h
===================================================================
--- libraries/fcollada/include/FUtils/FUFileManager.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/FUFileManager.h	(working copy)
@@ -15,14 +15,9 @@
 #ifndef _FU_FILE_MANAGER_H_
 #define _FU_FILE_MANAGER_H_
 
-#ifndef _FU_URI_H_
+#include "FMath/FMArray.h"
 #include "FUtils/FUUri.h"
-#endif //_FU_URI_H_
 
-#ifndef _FM_ARRAY_H_
-#include "FMath/FMArray.h"
-#endif //_FM_ARRAY_H_
-
 class FUFile;
 
 /** A scheme callback to load remote files.
Index: libraries/fcollada/include/FUtils/FUCriticalSection.h
===================================================================
--- libraries/fcollada/include/FUtils/FUCriticalSection.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/FUCriticalSection.h	(working copy)
@@ -33,7 +33,7 @@
 #elif defined(__APPLE__)
 	//Do something here.
 	MPCriticalRegionID criticalSection;
-#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #else
 #warning "FUCriticalSection: Critical section not implemented for other platforms."
 #endif
Index: libraries/fcollada/include/FUtils/FUParameter.h
===================================================================
--- libraries/fcollada/include/FUtils/FUParameter.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/FUParameter.h	(working copy)
@@ -167,7 +167,7 @@
 /** See above. */
 #define InitializeParameter(parameterName, ...) parameterName(__VA_ARGS__)
 
-#if defined(__APPLE__) || defined(LINUX)
+#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include "FUtils/FUParameter.hpp"
 #endif // __APPLE__
 
Index: libraries/fcollada/include/FUtils/FUErrorLog.h
===================================================================
--- libraries/fcollada/include/FUtils/FUErrorLog.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/FUErrorLog.h	(working copy)
@@ -14,9 +14,7 @@
 #ifndef _FU_ERROR_LOG_H_
 #define _FU_ERROR_LOG_H_
 
-#ifndef _FU_ERROR_H_
 #include "FUtils/FUError.h"
-#endif // _FU_ERROR_H_
 
 class FULogFile;
 
Index: libraries/fcollada/include/FUtils/FUAssert.h
===================================================================
--- libraries/fcollada/include/FUtils/FUAssert.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/FUAssert.h	(working copy)
@@ -14,9 +14,7 @@
 #ifndef _FU_ASSERT_H_
 #define _FU_ASSERT_H_
 
-#ifndef _FU_FUNCTOR_H_
 #include "FUtils/FUFunctor.h"
-#endif // _FU_FUNCTOR_H_
 
 namespace FUAssertion
 {
Index: libraries/fcollada/include/FUtils/FUError.h
===================================================================
--- libraries/fcollada/include/FUtils/FUError.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/FUError.h	(working copy)
@@ -14,12 +14,8 @@
 #ifndef _FU_ERROR_H_
 #define _FU_ERROR_H_
 
-#ifndef _FU_EVENT_H_
+#include "FUtils/FUCriticalSection.h"
 #include "FUtils/FUEvent.h"
-#endif // _FU_EVENT_H_
-#ifndef _FU_CRITICAL_SECTION_H_
-#include "FUtils/FUCriticalSection.h"
-#endif // _FU_CRITICAL_SECTION_H_
 
 /** Windows API defines this. */
 #undef ERROR
Index: libraries/fcollada/include/FUtils/FUPluginManager.h
===================================================================
--- libraries/fcollada/include/FUtils/FUPluginManager.h	(revision 11995)
+++ libraries/fcollada/include/FUtils/FUPluginManager.h	(working copy)
@@ -48,7 +48,7 @@
 		fstring filename;
 #if defined(WIN32)
 		HMODULE module;
-#elif defined(__APPLE__) || defined(LINUX)
+#elif defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 		void* module;
 #endif // WIN32
 
Index: libraries/fcollada/include/FCDocument/FCDEffectTools.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDEffectTools.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDEffectTools.h	(working copy)
@@ -33,9 +33,9 @@
 
 #if defined(WIN32)
 template <class T, int Q> class FCOLLADA_EXPORT FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
-#elif defined(LINUX) || defined(__APPLE__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 template <class T, int Q> class FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
-#endif // LINUX
+#endif // __linux__
 typedef FCDEffectParameterAnimatableT<FMVector4, 1> FCDEffectParameterColor4; /**< A RGBA color effect parameter. */
 typedef FCDEffectParameterAnimatableT<float, 0> FCDEffectParameterFloat; /**< A floating-point value effect parameter. */
 
Index: libraries/fcollada/include/FCDocument/FCDAnimationClip.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDAnimationClip.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDAnimationClip.h	(working copy)
@@ -22,13 +22,8 @@
 
 typedef FUTrackedList<FCDAnimationCurve> FCDAnimationCurveTrackList; /**< A dynamically-sized tracking array of animation curves. */
 
-#ifndef _FCD_ENTITY_H_
 #include "FCDocument/FCDEntity.h"
-#endif // _FCD_ENTITY_H_
-
-#ifndef _FCD_ENTITY_INSTANCE_H_
 #include "FCDocument/FCDEntityInstance.h"
-#endif // _FCD_ENTITY__INSTANCE_H_
 
 /**
 	A COLLADA animation clip.
Index: libraries/fcollada/include/FCDocument/FCDControllerInstance.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDControllerInstance.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDControllerInstance.h	(working copy)
@@ -14,13 +14,8 @@
 #ifndef _FCD_CONTROLLER_INSTANCE_H_
 #define _FCD_CONTROLLER_INSTANCE_H_
 
-#ifndef _FCD_GEOMETRY_ENTITY_H_
 #include "FCDocument/FCDGeometryInstance.h"
-#endif // _FCD_GEOMETRY_ENTITY_H_
-
-#ifndef _FU_URI_H_
 #include "FUtils/FUUri.h"
-#endif // _FU_URI_H_
 
 class FCDSkinController;
 class FCDSceneNode;
Index: libraries/fcollada/include/FCDocument/FCDEffectParameterSampler.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDEffectParameterSampler.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDEffectParameterSampler.h	(working copy)
@@ -14,13 +14,8 @@
 #ifndef _FCD_EFFECT_PARAMETER_SAMPLER_H_
 #define _FCD_EFFECT_PARAMETER_SAMPLER_H_
 
-#ifndef _FCD_EFFECT_PARAMETER_H_
 #include "FCDocument/FCDEffectParameter.h"
-#endif // _FCD_EFFECT_PARAMETER_H_
-
-#ifndef _FU_DAE_ENUM_H_
 #include "FUtils/FUDaeEnum.h"
-#endif // _FU_DAE_ENUM_H_
 
 class FCDocument;
 class FCDEffectPass;
Index: libraries/fcollada/include/FCDocument/FCDController.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDController.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDController.h	(working copy)
@@ -20,9 +20,7 @@
 #ifndef _FCD_CONTROLLER_H_
 #define _FCD_CONTROLLER_H_
 
-#ifndef _FCD_ENTITY_H_
 #include "FCDocument/FCDEntity.h"
-#endif // _FCD_ENTITY_H_
 
 class FCDocument;
 class FCDGeometry;
Index: libraries/fcollada/include/FCDocument/FCDEffectCode.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDEffectCode.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDEffectCode.h	(working copy)
@@ -14,9 +14,7 @@
 #ifndef _FCD_EFFECT_CODE_H_
 #define _FCD_EFFECT_CODE_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
 
 class FCDocument;
 
Index: libraries/fcollada/include/FCDocument/FCDAnimationChannel.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDAnimationChannel.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDAnimationChannel.h	(working copy)
@@ -20,12 +20,8 @@
 #ifndef _FCD_ANIMATION_CHANNEL_H_
 #define _FCD_ANIMATION_CHANNEL_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FU_PARAMETER_H_
 #include "FUtils/FUParameter.h"
-#endif // _FU_PARAMETER_H_
 
 class FCDAnimated;
 class FCDAnimation;
Index: libraries/fcollada/include/FCDocument/FCDEffectStandard.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDEffectStandard.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDEffectStandard.h	(working copy)
@@ -37,9 +37,9 @@
 
 #if defined(WIN32)
 template <class T, int Q> class FCOLLADA_EXPORT FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
-#elif defined(LINUX) || defined(__APPLE__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 template <class T, int Q> class FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
-#endif // LINUX
+#endif // __linux__
 typedef FCDEffectParameterAnimatableT<FMVector4, 1> FCDEffectParameterColor4; /**< A RGBA color effect parameter. */
 typedef FCDEffectParameterAnimatableT<float, 0> FCDEffectParameterFloat; /**< A floating-point value effect parameter. */
 
Index: libraries/fcollada/include/FCDocument/FCDCamera.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDCamera.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDCamera.h	(working copy)
@@ -20,12 +20,8 @@
 #ifndef _FCD_CAMERA_H_
 #define _FCD_CAMERA_H_
 
-#ifndef _FCD_TARGETED_ENTITY_H_
+#include "FCDocument/FCDParameterAnimatable.h"
 #include "FCDocument/FCDTargetedEntity.h"
-#endif // _FCD_TARGETED_ENTITY_H_
-#ifndef _FCD_PARAMETER_ANIMATABLE_H_
-#include "FCDocument/FCDParameterAnimatable.h"
-#endif // _FCD_PARAMETER_ANIMATABLE_H_
 
 class FCDocument;
 class FCDSceneNode;
Index: libraries/fcollada/include/FCDocument/FCDAsset.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDAsset.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDAsset.h	(working copy)
@@ -13,15 +13,9 @@
 #ifndef _FCD_ASSET_H_
 #define _FCD_ASSET_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FU_DATETIME_H_
 #include "FUtils/FUDateTime.h"
-#endif // _FU_DATETIME_H_
-#ifndef _FU_PARAMETER_H_
 #include "FUtils/FUParameter.h"
-#endif // _FU_PARAMETER_H_
 
 class FCDAssetContributor;
 
Index: libraries/fcollada/include/FCDocument/FCDParameterAnimatable.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDParameterAnimatable.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDParameterAnimatable.h	(working copy)
@@ -396,7 +396,7 @@
 /** See above. */
 #define InitializeParameterAnimatable(parameterName, ...) parameterName(this, __VA_ARGS__)
 
-#if defined(__APPLE__) || defined(LINUX)
+#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include <FCDocument/FCDParameterAnimatable.hpp>
 #endif // MAC + LINUX
 
Index: libraries/fcollada/include/FCDocument/FCDAnimationMultiCurve.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDAnimationMultiCurve.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDAnimationMultiCurve.h	(working copy)
@@ -20,12 +20,8 @@
 #ifndef _FCD_ANIMATION_MULTI_CURVE_H_
 #define _FCD_ANIMATION_MULTI_CURVE_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FU_DAE_ENUM_H_
 #include "FUtils/FUDaeEnum.h"
-#endif // _FU_DAE_ENUM_H_
 
 class FCDocument;
 class FCDAnimationMKey;
Index: libraries/fcollada/include/FCDocument/FCDEffect.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDEffect.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDEffect.h	(working copy)
@@ -20,12 +20,8 @@
 #ifndef _FCD_EFFECT_H_
 #define _FCD_EFFECT_H_
 
-#ifndef _FU_DAE_ENUM_H_
+#include "FCDocument/FCDEntity.h"
 #include "FUtils/FUDaeEnum.h"
-#endif // _FU_DAE_ENUM_H_
-#ifndef _FCD_ENTITY_H_
-#include "FCDocument/FCDEntity.h"
-#endif // _FCD_ENTITY_H_
 
 class FCDocument;
 class FCDEffectStandard;
Index: libraries/fcollada/include/FCDocument/FCDAnimated.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDAnimated.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDAnimated.h	(working copy)
@@ -20,9 +20,7 @@
 #ifndef _FCD_ANIMATED_H_
 #define _FCD_ANIMATED_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
 
 class FCDocument;
 class FCDAnimated;
Index: libraries/fcollada/include/FCDocument/FCDEffectParameter.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDEffectParameter.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDEffectParameter.h	(working copy)
@@ -15,12 +15,8 @@
 #ifndef _FCD_EFFECT_PARAMETER_H_
 #define _FCD_EFFECT_PARAMETER_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FCD_PARAMETER_ANIMATABLE_H_
 #include "FCDocument/FCDParameterAnimatable.h"
-#endif // _FCD_PARAMETER_ANIMATABLE_H_
 
 class FCDocument;
 class FCDEffectParameterAnnotation;
@@ -369,7 +365,7 @@
 	DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, value, FC("Value")); /**< The annotation value. */
 };
 
-#if defined(__APPLE__) || defined(LINUX)
+#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include <FCDocument/FCDEffectParameter.hpp>
 #endif
 
Index: libraries/fcollada/include/FCDocument/FCDAnimation.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDAnimation.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDAnimation.h	(working copy)
@@ -20,9 +20,7 @@
 #ifndef _FCD_ANIMATION_H_
 #define _FCD_ANIMATION_H_
 
-#ifndef _FCD_ENTITY_H_
 #include "FCDocument/FCDEntity.h"
-#endif // _FCD_ENTITY_H_
 
 class FCDocument;
 class FCDAnimated;
Index: libraries/fcollada/include/FCDocument/FCDAnimationCurve.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDAnimationCurve.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDAnimationCurve.h	(working copy)
@@ -14,12 +14,8 @@
 #ifndef _FCD_ANIMATION_CURVE_H_
 #define _FCD_ANIMATION_CURVE_H_
 
-#ifndef _FU_DAE_ENUM_H_
+#include "FCDocument/FCDObject.h"
 #include "FUtils/FUDaeEnum.h"
-#endif // _FU_DAE_ENUM_H_
-#ifndef __FCD_OBJECT_H_
-#include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
 
 class FCDAnimated;
 class FCDAnimationClip;
Index: libraries/fcollada/include/FCDocument/FCDocument.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDocument.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDocument.h	(working copy)
@@ -20,20 +20,16 @@
 #ifndef _FC_DOCUMENT_H_
 #define _FC_DOCUMENT_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FU_PARAMETER_H_
 #include "FUtils/FUParameter.h"
-#endif // _FU_PARAMETER_H_
 
 #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__) || defined(__OpenBSD__)
+#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
+#endif // __linux__
 
 class FCDAnimated;
 class FCDAnimation;
Index: libraries/fcollada/include/FCDocument/FCDTexture.h
===================================================================
--- libraries/fcollada/include/FCDocument/FCDTexture.h	(revision 11995)
+++ libraries/fcollada/include/FCDocument/FCDTexture.h	(working copy)
@@ -35,9 +35,9 @@
 
 #if defined(WIN32)
 template <class T> class FCOLLADA_EXPORT FCDEffectParameterT; /**< Trick Doxygen. */
-#elif defined(LINUX) || defined(__APPLE__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 template <class T> class FCDEffectParameterT; /**< Trick Doxygen. */
-#endif // LINUX
+#endif // __linux__
 typedef FCDEffectParameterT<int32> FCDEffectParameterInt; /**< An integer effect parameter. */
 
 /**
Index: libraries/fcollada/src/FCollada/FCDocument/FCDAnimationClip.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDAnimationClip.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDAnimationClip.h	(working copy)
@@ -22,13 +22,8 @@
 
 typedef FUTrackedList<FCDAnimationCurve> FCDAnimationCurveTrackList; /**< A dynamically-sized tracking array of animation curves. */
 
-#ifndef _FCD_ENTITY_H_
 #include "FCDocument/FCDEntity.h"
-#endif // _FCD_ENTITY_H_
-
-#ifndef _FCD_ENTITY_INSTANCE_H_
 #include "FCDocument/FCDEntityInstance.h"
-#endif // _FCD_ENTITY__INSTANCE_H_
 
 /**
 	A COLLADA animation clip.
Index: libraries/fcollada/src/FCollada/FCDocument/FCDControllerInstance.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDControllerInstance.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDControllerInstance.h	(working copy)
@@ -14,13 +14,8 @@
 #ifndef _FCD_CONTROLLER_INSTANCE_H_
 #define _FCD_CONTROLLER_INSTANCE_H_
 
-#ifndef _FCD_GEOMETRY_ENTITY_H_
 #include "FCDocument/FCDGeometryInstance.h"
-#endif // _FCD_GEOMETRY_ENTITY_H_
-
-#ifndef _FU_URI_H_
 #include "FUtils/FUUri.h"
-#endif // _FU_URI_H_
 
 class FCDSkinController;
 class FCDSceneNode;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameterSampler.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameterSampler.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameterSampler.h	(working copy)
@@ -14,13 +14,8 @@
 #ifndef _FCD_EFFECT_PARAMETER_SAMPLER_H_
 #define _FCD_EFFECT_PARAMETER_SAMPLER_H_
 
-#ifndef _FCD_EFFECT_PARAMETER_H_
 #include "FCDocument/FCDEffectParameter.h"
-#endif // _FCD_EFFECT_PARAMETER_H_
-
-#ifndef _FU_DAE_ENUM_H_
 #include "FUtils/FUDaeEnum.h"
-#endif // _FU_DAE_ENUM_H_
 
 class FCDocument;
 class FCDEffectPass;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDController.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDController.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDController.h	(working copy)
@@ -20,9 +20,7 @@
 #ifndef _FCD_CONTROLLER_H_
 #define _FCD_CONTROLLER_H_
 
-#ifndef _FCD_ENTITY_H_
 #include "FCDocument/FCDEntity.h"
-#endif // _FCD_ENTITY_H_
 
 class FCDocument;
 class FCDGeometry;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDEffectCode.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDEffectCode.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDEffectCode.h	(working copy)
@@ -14,9 +14,7 @@
 #ifndef _FCD_EFFECT_CODE_H_
 #define _FCD_EFFECT_CODE_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
 
 class FCDocument;
 
Index: libraries/fcollada/src/FCollada/FCDocument/FCDAnimationChannel.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDAnimationChannel.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDAnimationChannel.h	(working copy)
@@ -20,12 +20,8 @@
 #ifndef _FCD_ANIMATION_CHANNEL_H_
 #define _FCD_ANIMATION_CHANNEL_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FU_PARAMETER_H_
 #include "FUtils/FUParameter.h"
-#endif // _FU_PARAMETER_H_
 
 class FCDAnimated;
 class FCDAnimation;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDEffectStandard.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDEffectStandard.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDEffectStandard.h	(working copy)
@@ -37,9 +37,9 @@
 
 #if defined(WIN32)
 template <class T, int Q> class FCOLLADA_EXPORT FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
-#elif defined(LINUX) || defined(__APPLE__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 template <class T, int Q> class FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
-#endif // LINUX
+#endif // __linux__
 typedef FCDEffectParameterAnimatableT<FMVector4, 1> FCDEffectParameterColor4; /**< A RGBA color effect parameter. */
 typedef FCDEffectParameterAnimatableT<float, 0> FCDEffectParameterFloat; /**< A floating-point value effect parameter. */
 
Index: libraries/fcollada/src/FCollada/FCDocument/FCDParameterAnimatable.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDParameterAnimatable.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDParameterAnimatable.h	(working copy)
@@ -396,7 +396,7 @@
 /** See above. */
 #define InitializeParameterAnimatable(parameterName, ...) parameterName(this, __VA_ARGS__)
 
-#if defined(__APPLE__) || defined(LINUX)
+#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include <FCDocument/FCDParameterAnimatable.hpp>
 #endif // MAC + LINUX
 
Index: libraries/fcollada/src/FCollada/FCDocument/FCDAnimationMultiCurve.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDAnimationMultiCurve.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDAnimationMultiCurve.h	(working copy)
@@ -20,12 +20,8 @@
 #ifndef _FCD_ANIMATION_MULTI_CURVE_H_
 #define _FCD_ANIMATION_MULTI_CURVE_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FU_DAE_ENUM_H_
 #include "FUtils/FUDaeEnum.h"
-#endif // _FU_DAE_ENUM_H_
 
 class FCDocument;
 class FCDAnimationMKey;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDParameterAnimatable.cpp
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDParameterAnimatable.cpp	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDParameterAnimatable.cpp	(working copy)
@@ -8,7 +8,7 @@
 
 #include "StdAfx.h"
 #include "FCDParameterAnimatable.h"
-#if !defined (__APPLE__) && !defined(LINUX)
+#if !defined(__APPLE__) && !defined(__linux__) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__)
 #include "FCDParameterAnimatable.hpp"
 #endif
 #include "FCDAnimated.h"
Index: libraries/fcollada/src/FCollada/FCDocument/FCDAnimated.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDAnimated.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDAnimated.h	(working copy)
@@ -20,9 +20,7 @@
 #ifndef _FCD_ANIMATED_H_
 #define _FCD_ANIMATED_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
 
 class FCDocument;
 class FCDAnimated;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDAnimation.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDAnimation.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDAnimation.h	(working copy)
@@ -20,9 +20,7 @@
 #ifndef _FCD_ANIMATION_H_
 #define _FCD_ANIMATION_H_
 
-#ifndef _FCD_ENTITY_H_
 #include "FCDocument/FCDEntity.h"
-#endif // _FCD_ENTITY_H_
 
 class FCDocument;
 class FCDAnimated;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDAnimationCurve.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDAnimationCurve.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDAnimationCurve.h	(working copy)
@@ -14,12 +14,8 @@
 #ifndef _FCD_ANIMATION_CURVE_H_
 #define _FCD_ANIMATION_CURVE_H_
 
-#ifndef _FU_DAE_ENUM_H_
+#include "FCDocument/FCDObject.h"
 #include "FUtils/FUDaeEnum.h"
-#endif // _FU_DAE_ENUM_H_
-#ifndef __FCD_OBJECT_H_
-#include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
 
 class FCDAnimated;
 class FCDAnimationClip;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDocument.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDocument.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDocument.h	(working copy)
@@ -20,20 +20,16 @@
 #ifndef _FC_DOCUMENT_H_
 #define _FC_DOCUMENT_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FU_PARAMETER_H_
 #include "FUtils/FUParameter.h"
-#endif // _FU_PARAMETER_H_
 
 #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__) || defined(__OpenBSD__)
+#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
+#endif // __linux__
 
 class FCDAnimated;
 class FCDAnimation;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDEffectTools.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDEffectTools.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDEffectTools.h	(working copy)
@@ -33,9 +33,9 @@
 
 #if defined(WIN32)
 template <class T, int Q> class FCOLLADA_EXPORT FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
-#elif defined(LINUX) || defined(__APPLE__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 template <class T, int Q> class FCDEffectParameterAnimatableT; /**< Trick Doxygen. */
-#endif // LINUX
+#endif // __linux__
 typedef FCDEffectParameterAnimatableT<FMVector4, 1> FCDEffectParameterColor4; /**< A RGBA color effect parameter. */
 typedef FCDEffectParameterAnimatableT<float, 0> FCDEffectParameterFloat; /**< A floating-point value effect parameter. */
 
Index: libraries/fcollada/src/FCollada/FCDocument/FCDCamera.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDCamera.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDCamera.h	(working copy)
@@ -20,12 +20,8 @@
 #ifndef _FCD_CAMERA_H_
 #define _FCD_CAMERA_H_
 
-#ifndef _FCD_TARGETED_ENTITY_H_
+#include "FCDocument/FCDParameterAnimatable.h"
 #include "FCDocument/FCDTargetedEntity.h"
-#endif // _FCD_TARGETED_ENTITY_H_
-#ifndef _FCD_PARAMETER_ANIMATABLE_H_
-#include "FCDocument/FCDParameterAnimatable.h"
-#endif // _FCD_PARAMETER_ANIMATABLE_H_
 
 class FCDocument;
 class FCDSceneNode;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDAsset.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDAsset.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDAsset.h	(working copy)
@@ -13,15 +13,9 @@
 #ifndef _FCD_ASSET_H_
 #define _FCD_ASSET_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FU_DATETIME_H_
 #include "FUtils/FUDateTime.h"
-#endif // _FU_DATETIME_H_
-#ifndef _FU_PARAMETER_H_
 #include "FUtils/FUParameter.h"
-#endif // _FU_PARAMETER_H_
 
 class FCDAssetContributor;
 
Index: libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameter.cpp
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameter.cpp	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameter.cpp	(working copy)
@@ -14,7 +14,7 @@
 #include "FCDEffectParameter.h"
 #include "FCDEffectParameterFactory.h"
 #include "FCDImage.h"
-#if !defined(__APPLE__) && !defined(LINUX)
+#if !defined(__APPLE__) && !defined(__linux__) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__)
 #include "FCDEffectParameter.hpp"
 #endif
 
Index: libraries/fcollada/src/FCollada/FCDocument/FCDEffect.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDEffect.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDEffect.h	(working copy)
@@ -20,12 +20,8 @@
 #ifndef _FCD_EFFECT_H_
 #define _FCD_EFFECT_H_
 
-#ifndef _FU_DAE_ENUM_H_
+#include "FCDocument/FCDEntity.h"
 #include "FUtils/FUDaeEnum.h"
-#endif // _FU_DAE_ENUM_H_
-#ifndef _FCD_ENTITY_H_
-#include "FCDocument/FCDEntity.h"
-#endif // _FCD_ENTITY_H_
 
 class FCDocument;
 class FCDEffectStandard;
Index: libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameter.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameter.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDEffectParameter.h	(working copy)
@@ -15,12 +15,8 @@
 #ifndef _FCD_EFFECT_PARAMETER_H_
 #define _FCD_EFFECT_PARAMETER_H_
 
-#ifndef __FCD_OBJECT_H_
 #include "FCDocument/FCDObject.h"
-#endif // __FCD_OBJECT_H_
-#ifndef _FCD_PARAMETER_ANIMATABLE_H_
 #include "FCDocument/FCDParameterAnimatable.h"
-#endif // _FCD_PARAMETER_ANIMATABLE_H_
 
 class FCDocument;
 class FCDEffectParameterAnnotation;
@@ -369,7 +365,7 @@
 	DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, value, FC("Value")); /**< The annotation value. */
 };
 
-#if defined(__APPLE__) || defined(LINUX)
+#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include <FCDocument/FCDEffectParameter.hpp>
 #endif
 
Index: libraries/fcollada/src/FCollada/FCDocument/FCDTexture.h
===================================================================
--- libraries/fcollada/src/FCollada/FCDocument/FCDTexture.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FCDocument/FCDTexture.h	(working copy)
@@ -35,9 +35,9 @@
 
 #if defined(WIN32)
 template <class T> class FCOLLADA_EXPORT FCDEffectParameterT; /**< Trick Doxygen. */
-#elif defined(LINUX) || defined(__APPLE__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 template <class T> class FCDEffectParameterT; /**< Trick Doxygen. */
-#endif // LINUX
+#endif // __linux__
 typedef FCDEffectParameterT<int32> FCDEffectParameterInt; /**< An integer effect parameter. */
 
 /**
Index: libraries/fcollada/src/FCollada/Sconscript
===================================================================
--- libraries/fcollada/src/FCollada/Sconscript	(revision 11995)
+++ libraries/fcollada/src/FCollada/Sconscript	(working copy)
@@ -12,7 +12,6 @@
 env.Append(CPPPATH = [sconscriptRelativePath, sconscriptRelativePath + "LibXML/include"])
 
 #Add the macros defined for all the builds
-env.Append(CPPDEFINES = ['LINUX'])
 if int(ifshared) != 0: env.Append(CPPDEFINES = ['FCOLLADA_DLL'])
 env.Append(CCFLAGS = ['-W', '-Wall', '-Wno-unused-parameter', '-Wno-unused-function'])
 
Index: libraries/fcollada/src/FCollada/FColladaTest/Sconscript
===================================================================
--- libraries/fcollada/src/FCollada/FColladaTest/Sconscript	(revision 11995)
+++ libraries/fcollada/src/FCollada/FColladaTest/Sconscript	(working copy)
@@ -9,7 +9,7 @@
 env.Append(CPPPATH = [sconscriptRelativePath, sconscriptRelativePath + "/..", sconscriptRelativePath + "/../LibXML/include/"])
 
 #Add the macros defined for all the builds
-env.Append(CPPDEFINES = ['LINUX', '_DEBUG'])
+env.Append(CPPDEFINES = ['_DEBUG'])
 env.Append(CCFLAGS = ['-O0', '-g', '-W', '-Wall'])
 
 #Unicode is pre-requisite to building the test for FCollada.
Index: libraries/fcollada/src/FCollada/FUtils/FUCriticalSection.h
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUCriticalSection.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUCriticalSection.h	(working copy)
@@ -33,7 +33,7 @@
 #elif defined(__APPLE__)
 	//Do something here.
 	MPCriticalRegionID criticalSection;
-#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #else
 #warning "FUCriticalSection: Critical section not implemented for other platforms."
 #endif
Index: libraries/fcollada/src/FCollada/FUtils/FUFileManager.cpp
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUFileManager.cpp	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUFileManager.cpp	(working copy)
@@ -24,7 +24,7 @@
 #elif defined(__APPLE__)
 	#include <mach-o/dyld.h>
 	typedef int (*NSGetExecutablePathProcPtr)(char *buf, size_t *bufsize);
-#elif defined(LINUX)
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -210,7 +210,7 @@
 	if (_mkdir(TO_STRING(absoluteDirectory).c_str()) == 0) return true;
 	errno_t err; _get_errno(&err);
 	if (err == EEXIST) return true;
-#elif defined(LINUX)
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 	if (mkdir(TO_STRING(absoluteDirectory).c_str(), ~0u) == 0) return true; // I think this means all permissions..
 #elif defined(__APPLE__)
 	fm::string _fname = TO_STRING(directory);
@@ -374,7 +374,7 @@
 	GetModuleFileName(NULL, buffer, 1024);
 	buffer[1023] = 0;
 	_uri = buffer;
-#elif defined(LINUX)
+#elif defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 	char path[1024]; 
 	char path2[1024];
 	struct stat stat_buf;
Index: libraries/fcollada/src/FCollada/FUtils/FUPluginManager.cpp
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUPluginManager.cpp	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUPluginManager.cpp	(working copy)
@@ -24,7 +24,7 @@
 		#define ffindclose _findclose
 		#define ffindnext _findnext
 	#endif
-#elif defined(__APPLE__) || defined(LINUX)
+#elif defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 	#include <dlfcn.h>
 	#include <dirent.h>
 #endif //WIN32
@@ -128,7 +128,7 @@
 			ffindclose(folderHandle);
 		}
 
-#elif defined(__APPLE__) || defined(LINUX)
+#elif defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 		fm::string s_filter = TO_STRING(filter);
 		if (s_filter.length() > 0 && s_filter.front() == '*') s_filter.erase(0, 1);
 		if (s_filter.length() > 0 && s_filter.back() == '*') s_filter.pop_back();
@@ -179,7 +179,7 @@
 	{
 #if defined(WIN32)
 		if ((*it)->module != NULL) FreeLibrary((*it)->module);
-#elif defined(LINUX) || defined(__APPLE__)
+#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 		if ((*it)->module != NULL) dlclose((*it)->module);
 #endif // WIN32
 	}
Index: libraries/fcollada/src/FCollada/FUtils/FUAssert.h
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUAssert.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUAssert.h	(working copy)
@@ -14,9 +14,7 @@
 #ifndef _FU_ASSERT_H_
 #define _FU_ASSERT_H_
 
-#ifndef _FU_FUNCTOR_H_
 #include "FUtils/FUFunctor.h"
-#endif // _FU_FUNCTOR_H_
 
 namespace FUAssertion
 {
Index: libraries/fcollada/src/FCollada/FUtils/FUError.h
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUError.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUError.h	(working copy)
@@ -14,12 +14,8 @@
 #ifndef _FU_ERROR_H_
 #define _FU_ERROR_H_
 
-#ifndef _FU_EVENT_H_
+#include "FUtils/FUCriticalSection.h"
 #include "FUtils/FUEvent.h"
-#endif // _FU_EVENT_H_
-#ifndef _FU_CRITICAL_SECTION_H_
-#include "FUtils/FUCriticalSection.h"
-#endif // _FU_CRITICAL_SECTION_H_
 
 /** Windows API defines this. */
 #undef ERROR
Index: libraries/fcollada/src/FCollada/FUtils/Platforms.h
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/Platforms.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/Platforms.h	(working copy)
@@ -27,7 +27,7 @@
 #define FCOLLADA_EXPORT __declspec(dllimport)
 #define FCOLLADA_LOCAL
 #endif // FCOLLADA_INTERNAL
-#elif defined(__APPLE__) || defined(LINUX)
+#elif defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #define FCOLLADA_EXPORT __attribute__((visibility("default")))
 #define FCOLLADA_LOCAL __attribute__((visibility("hidden")))
 #endif
@@ -74,7 +74,7 @@
 #include <wchar.h>
 #include <stdint.h>
 
-#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+#elif defined(__linux__) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include <ctype.h>
 #include <wctype.h>
 #include <unistd.h>
@@ -125,7 +125,7 @@
 #endif // PLATFORMS
 
 // Important functions that some OSes have missing!
-#if defined(__APPLE__) || defined (LINUX) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+#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; }
@@ -139,7 +139,7 @@
 #elif defined(__PPU__)
 #define glClearDepth glClearDepthf
 
-#endif // __APPLE__ and LINUX
+#endif // __APPLE__ || __linux__ || __FreeBSD__ || __FreeBSD_kernel__ || __OpenBSD__
 
 // Cross-platform needed functions
 #ifdef WIN32
Index: libraries/fcollada/src/FCollada/FUtils/FUEvent.h
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUEvent.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUEvent.h	(working copy)
@@ -18,9 +18,7 @@
 #ifndef _FU_EVENT_H_
 #define _FU_EVENT_H_
 
-#ifndef _FU_FUNCTOR_H_
 #include "FUtils/FUFunctor.h"
-#endif // _FU_FUNCTOR_H_
 
 /**
 	An event with no argument.
Index: libraries/fcollada/src/FCollada/FUtils/FUDebug.cpp
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUDebug.cpp	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUDebug.cpp	(working copy)
@@ -18,7 +18,7 @@
 FUDebug::FUDebug() {}
 FUDebug::~FUDebug() {}
 
-#if defined(LINUX) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #if defined(UNICODE)
 #define STRING_OUT(sz) fprintf(stderr, "%s", TO_STRING(sz).c_str()); fflush(stderr);
 #else
Index: libraries/fcollada/src/FCollada/FUtils/FUFileManager.h
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUFileManager.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUFileManager.h	(working copy)
@@ -15,14 +15,9 @@
 #ifndef _FU_FILE_MANAGER_H_
 #define _FU_FILE_MANAGER_H_
 
-#ifndef _FU_URI_H_
+#include "FMath/FMArray.h"
 #include "FUtils/FUUri.h"
-#endif //_FU_URI_H_
 
-#ifndef _FM_ARRAY_H_
-#include "FMath/FMArray.h"
-#endif //_FM_ARRAY_H_
-
 class FUFile;
 
 /** A scheme callback to load remote files.
Index: libraries/fcollada/src/FCollada/FUtils/FUParameter.h
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUParameter.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUParameter.h	(working copy)
@@ -167,7 +167,7 @@
 /** See above. */
 #define InitializeParameter(parameterName, ...) parameterName(__VA_ARGS__)
 
-#if defined(__APPLE__) || defined(LINUX)
+#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 #include "FUtils/FUParameter.hpp"
 #endif // __APPLE__
 
Index: libraries/fcollada/src/FCollada/FUtils/FUParameter.cpp
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUParameter.cpp	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUParameter.cpp	(working copy)
@@ -10,7 +10,7 @@
 #include "FUParameterizable.h"
 #include "FUParameter.h"
 #include <FCDocument/FCDParameterAnimatable.h>
-#if !defined(__APPLE__) && !defined(LINUX)
+#if !defined(__APPLE__) && !defined(__linux__) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__)
 #include "FUParameter.hpp"
 #endif
 
Index: libraries/fcollada/src/FCollada/FUtils/FUErrorLog.h
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUErrorLog.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUErrorLog.h	(working copy)
@@ -14,9 +14,7 @@
 #ifndef _FU_ERROR_LOG_H_
 #define _FU_ERROR_LOG_H_
 
-#ifndef _FU_ERROR_H_
 #include "FUtils/FUError.h"
-#endif // _FU_ERROR_H_
 
 class FULogFile;
 
Index: libraries/fcollada/src/FCollada/FUtils/FUPluginManager.h
===================================================================
--- libraries/fcollada/src/FCollada/FUtils/FUPluginManager.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FUtils/FUPluginManager.h	(working copy)
@@ -48,7 +48,7 @@
 		fstring filename;
 #if defined(WIN32)
 		HMODULE module;
-#elif defined(__APPLE__) || defined(LINUX)
+#elif defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 		void* module;
 #endif // WIN32
 
Index: libraries/fcollada/src/FCollada/DLLEntry.cpp
===================================================================
--- libraries/fcollada/src/FCollada/DLLEntry.cpp	(revision 11995)
+++ libraries/fcollada/src/FCollada/DLLEntry.cpp	(working copy)
@@ -44,7 +44,7 @@
 	hInstance = _hInstance;
 	return TRUE;
 }
-#elif defined(__APPLE__) || defined(LINUX)
+#elif defined(__APPLE__) || defined(__linux__)  || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
 void __attribute((constructor)) DllEntry(void)
 {
 }
Index: libraries/fcollada/src/FCollada/FMath/FMArrayPointer.h
===================================================================
--- libraries/fcollada/src/FCollada/FMath/FMArrayPointer.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FMath/FMArrayPointer.h	(working copy)
@@ -15,9 +15,7 @@
 #ifndef _FM_ARRAY_POINTER_H_
 #define _FM_ARRAY_POINTER_H_
 
-#ifndef _FM_ARRAY_H_
 #include "FMath/FMArray.h"
-#endif // _FM_ARRAY_H_
 
 // Already documented in FMArray.h.
 namespace fm
Index: libraries/fcollada/src/FCollada/FMath/FMTree.h
===================================================================
--- libraries/fcollada/src/FCollada/FMath/FMTree.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FMath/FMTree.h	(working copy)
@@ -14,9 +14,7 @@
 #ifndef _FM_TREE_H_
 #define _FM_TREE_H_
 
-#ifndef _FM_ALLOCATOR_H_
 #include "FMath/FMAllocator.h"
-#endif // _FM_ALLOCATOR_H_
 
 namespace fm
 {
Index: libraries/fcollada/src/FCollada/FMath/FMFloat.h
===================================================================
--- libraries/fcollada/src/FCollada/FMath/FMFloat.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FMath/FMFloat.h	(working copy)
@@ -14,7 +14,7 @@
 #ifndef _FM_FLOAT_H_
 #define _FM_FLOAT_H_
 
-#if !defined(_INC_FLOAT) && (defined (WIN32) || defined (LINUX) || defined(__APPLE__))
+#if !defined(_INC_FLOAT) && (defined (WIN32) || defined (__linux__) || defined(__APPLE__))
 #include <float.h>
 #endif // _INC_FLOAT, WIN32 and LINUX
 
Index: libraries/fcollada/src/FCollada/FMath/FMArray.h
===================================================================
--- libraries/fcollada/src/FCollada/FMath/FMArray.h	(revision 11995)
+++ libraries/fcollada/src/FCollada/FMath/FMArray.h	(working copy)
@@ -14,12 +14,8 @@
 #ifndef _FM_ARRAY_H_
 #define _FM_ARRAY_H_
 
-#ifndef _FM_ALLOCATOR_H_
 #include "FMath/FMAllocator.h"
-#endif // _FM_ALLOCATOR_H_
-#ifndef _FM_SORT_H_
 #include "FMath/FMSort.h"
-#endif // _FM_SORT_H_
 
 #ifdef WIN32
 #pragma warning(disable:4127)
Index: libraries/fcollada/src/Makefile
===================================================================
--- libraries/fcollada/src/Makefile	(revision 11995)
+++ libraries/fcollada/src/Makefile	(working copy)
@@ -3,12 +3,11 @@
 ifeq ($(OS_ARCH),Darwin)
 PIC_FLAGS ?= -fPIC
 else
-OS_DEFINE ?= -DLINUX
 PIC_FLAGS ?= -fpic
 endif
 
 CXX ?= g++
-CXXFLAGS += -fvisibility=hidden -W -Wall -Wno-unused-parameter -Wno-unused-function $(OS_DEFINE) $(PIC_FLAGS) $(CPPFLAGS)
+CXXFLAGS += -fvisibility=hidden -W -Wall -Wno-unused-parameter -Wno-unused-function $(PIC_FLAGS) $(CPPFLAGS)
 CXXFLAGS_DEBUG := -O0 -g -D_DEBUG -DRETAIL
 CXXFLAGS_RELEASE := -O1 -DNDEBUG -DRETAIL
 # (-O2 with gcc 4.3 causes linker errors when using this library, for unknown reasons, so stick with -O1)
