Merged changes from MojoSetup.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 17 Mar 2008 23:16:52 +0000
changeset 495 16e08147c906
parent 494 9b66c53c1ed8
child 496 68bd78c489b3
Merged changes from MojoSetup.
src/buildver.c
--- a/src/buildver.c	Mon Mar 17 23:11:15 2008 +0000
+++ b/src/buildver.c	Mon Mar 17 23:16:52 2008 +0000
@@ -27,16 +27,22 @@
 #error Please define APPREV in the build system.
 #endif
 
-#ifndef __VERSION__
-#define __VERSION__ (Unknown compiler version)
+#if (defined __GNUC__)
+#   define VERSTR2(x) #x
+#   define VERSTR(x) VERSTR2(x)
+#   define COMPILERVER " " VERSTR(__GNUC__) "." VERSTR(__GNUC_MINOR__) "." VERSTR(__GNUC_PATCHLEVEL__)
+#elif (defined __VERSION__)
+#   define COMPILERVER " " __VERSION__
+#else
+#   define COMPILERVER ""
 #endif
 
 #ifndef __DATE__
-#define __DATE__ (Unknown build date)
+#define __DATE__ "(Unknown build date)"
 #endif
 
 #ifndef __TIME__
-#define __TIME__ (Unknown build time)
+#define __TIME__ "(Unknown build time)"
 #endif
 
 #ifndef COMPILER
@@ -49,10 +55,10 @@
   #endif
 #endif
 
-/* macro mess so we can turn APPID and APPREV into a string literal... */
+// macro mess so we can turn APPID and APPREV into a string literal...
 #define MAKEBUILDVERSTRINGLITERAL2(id, rev) \
-    #id ", Revision " #rev ", Built " __DATE__ " " __TIME__ ", by " \
-    COMPILER " version " __VERSION__
+    #id ", revision " #rev ", built " __DATE__ " " __TIME__ \
+    ", by " COMPILER COMPILERVER
 
 #define MAKEBUILDVERSTRINGLITERAL(id, rev) MAKEBUILDVERSTRINGLITERAL2(id, rev)