+#if defined(__BEOS__)
+#define PLATFORM_BEOS
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "BeOS"
+#endif
+
+#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
+#define PLATFORM_BSDI
+#define PLATFORM_BSD
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "BSDI"
+#endif
+
+#if defined(_arch_dreamcast)
+#define PLATFORM_DREAMCAST
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "Dreamcast"
+#endif
+
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#define PLATFORM_FREEBSD
+#define PLATFORM_BSD
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "FreeBSD"
+#endif
+
+#if defined(hpux) || defined(__hpux) || defined(__hpux__)
+#define PLATFORM_HPUX
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "HP-UX"
+#endif
+
+#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
+#define PLATFORM_IRIX
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "IRIX"
+#endif
+
+#if defined(linux) || defined(__linux) || defined(__linux__)
+#define PLATFORM_LINUX
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "Linux"
+#endif
+
+#if defined(__APPLE__) && defined(__MACH__)
+#define PLATFORM_MACOSX
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "Mac OS X"
+#endif
+
+#if defined(__NetBSD__)
+#define PLATFORM_NETBSD
+#define PLATFORM_BSD
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "NetBSD"
+#endif
+
+#if defined(NeXT)
+#define PLATFORM_NEXT
+#undef PLATFORM_STRING
+#define PLATFORM_STRING "NeXT"