Fossil SCM

Further improve reporting of the compiler version information.

mistachkin 2014-02-15 03:03 trunk
Commit b065aff4b94996282c40e4b1b705ada3ca290da2
+22 -6
--- src/config.h
+++ src/config.h
@@ -65,13 +65,13 @@
6565
#endif
6666
6767
/*
6868
** Utility macro to wrap an argument with double quotes.
6969
*/
70
-#if !defined(COMPILER_NAME_STRINGIFY)
71
-# define COMPILER_NAME_STRINGIFY(x) COMPILER_NAME_STRINGIFY1(x)
72
-# define COMPILER_NAME_STRINGIFY1(x) #x
70
+#if !defined(COMPILER_STRINGIFY)
71
+# define COMPILER_STRINGIFY(x) COMPILER_STRINGIFY1(x)
72
+# define COMPILER_STRINGIFY1(x) #x
7373
#endif
7474
7575
/*
7676
** Define the compiler variant, used to compile the project
7777
*/
@@ -83,17 +83,33 @@
8383
# define COMPILER_NAME "pellesc64"
8484
# else
8585
# define COMPILER_NAME "pellesc32"
8686
# endif
8787
# elif defined(_MSC_VER)
88
-# define COMPILER_NAME "msc-" COMPILER_NAME_STRINGIFY(_MSC_VER)
88
+# if !defined(COMPILER_VERSION)
89
+# define COMPILER_VERSION COMPILER_STRINGIFY(_MSC_VER)
90
+# endif
91
+# define COMPILER_NAME "msc-" COMPILER_VERSION
8992
# elif defined(__MINGW32__)
90
-# define COMPILER_NAME "mingw32-" COMPILER_NAME_STRINGIFY(__MINGW32_VERSION)
93
+# if defined(__GNUC__) && defined(__VERSION__)
94
+# if !defined(COMPILER_VERSION)
95
+# define COMPILER_VERSION COMPILER_STRINGIFY(__MINGW32_VERSION) "-gcc-" __VERSION__
96
+# endif
97
+# define COMPILER_NAME "mingw32-" COMPILER_VERSION
98
+# else
99
+# if !defined(COMPILER_VERSION)
100
+# define COMPILER_VERSION COMPILER_STRINGIFY(__MINGW32_VERSION)
101
+# endif
102
+# define COMPILER_NAME "mingw32-" COMPILER_VERSION
103
+# endif
91104
# elif defined(_WIN32)
92105
# define COMPILER_NAME "win32"
93106
# elif defined(__GNUC__)
94
-# define COMPILER_NAME "gcc-" __VERSION__
107
+# if !defined(COMPILER_VERSION)
108
+# define COMPILER_VERSION __VERSION__
109
+# endif
110
+# define COMPILER_NAME "gcc-" COMPILER_VERSION
95111
# else
96112
# define COMPILER_NAME "unknown"
97113
# endif
98114
#endif
99115
100116
--- src/config.h
+++ src/config.h
@@ -65,13 +65,13 @@
65 #endif
66
67 /*
68 ** Utility macro to wrap an argument with double quotes.
69 */
70 #if !defined(COMPILER_NAME_STRINGIFY)
71 # define COMPILER_NAME_STRINGIFY(x) COMPILER_NAME_STRINGIFY1(x)
72 # define COMPILER_NAME_STRINGIFY1(x) #x
73 #endif
74
75 /*
76 ** Define the compiler variant, used to compile the project
77 */
@@ -83,17 +83,33 @@
83 # define COMPILER_NAME "pellesc64"
84 # else
85 # define COMPILER_NAME "pellesc32"
86 # endif
87 # elif defined(_MSC_VER)
88 # define COMPILER_NAME "msc-" COMPILER_NAME_STRINGIFY(_MSC_VER)
 
 
 
89 # elif defined(__MINGW32__)
90 # define COMPILER_NAME "mingw32-" COMPILER_NAME_STRINGIFY(__MINGW32_VERSION)
 
 
 
 
 
 
 
 
 
 
91 # elif defined(_WIN32)
92 # define COMPILER_NAME "win32"
93 # elif defined(__GNUC__)
94 # define COMPILER_NAME "gcc-" __VERSION__
 
 
 
95 # else
96 # define COMPILER_NAME "unknown"
97 # endif
98 #endif
99
100
--- src/config.h
+++ src/config.h
@@ -65,13 +65,13 @@
65 #endif
66
67 /*
68 ** Utility macro to wrap an argument with double quotes.
69 */
70 #if !defined(COMPILER_STRINGIFY)
71 # define COMPILER_STRINGIFY(x) COMPILER_STRINGIFY1(x)
72 # define COMPILER_STRINGIFY1(x) #x
73 #endif
74
75 /*
76 ** Define the compiler variant, used to compile the project
77 */
@@ -83,17 +83,33 @@
83 # define COMPILER_NAME "pellesc64"
84 # else
85 # define COMPILER_NAME "pellesc32"
86 # endif
87 # elif defined(_MSC_VER)
88 # if !defined(COMPILER_VERSION)
89 # define COMPILER_VERSION COMPILER_STRINGIFY(_MSC_VER)
90 # endif
91 # define COMPILER_NAME "msc-" COMPILER_VERSION
92 # elif defined(__MINGW32__)
93 # if defined(__GNUC__) && defined(__VERSION__)
94 # if !defined(COMPILER_VERSION)
95 # define COMPILER_VERSION COMPILER_STRINGIFY(__MINGW32_VERSION) "-gcc-" __VERSION__
96 # endif
97 # define COMPILER_NAME "mingw32-" COMPILER_VERSION
98 # else
99 # if !defined(COMPILER_VERSION)
100 # define COMPILER_VERSION COMPILER_STRINGIFY(__MINGW32_VERSION)
101 # endif
102 # define COMPILER_NAME "mingw32-" COMPILER_VERSION
103 # endif
104 # elif defined(_WIN32)
105 # define COMPILER_NAME "win32"
106 # elif defined(__GNUC__)
107 # if !defined(COMPILER_VERSION)
108 # define COMPILER_VERSION __VERSION__
109 # endif
110 # define COMPILER_NAME "gcc-" COMPILER_VERSION
111 # else
112 # define COMPILER_NAME "unknown"
113 # endif
114 #endif
115
116
+1 -1
--- src/json.c
+++ src/json.c
@@ -30,12 +30,12 @@
3030
** dispatch to a JSON-mode-specific command/page handler with the type fossil_json_f().
3131
** See the API docs for that typedef (below) for the semantics of the callbacks.
3232
**
3333
**
3434
*/
35
-#include "config.h"
3635
#include "VERSION.h"
36
+#include "config.h"
3737
#include "json.h"
3838
#include <assert.h>
3939
#include <time.h>
4040
4141
#if INTERFACE
4242
--- src/json.c
+++ src/json.c
@@ -30,12 +30,12 @@
30 ** dispatch to a JSON-mode-specific command/page handler with the type fossil_json_f().
31 ** See the API docs for that typedef (below) for the semantics of the callbacks.
32 **
33 **
34 */
35 #include "config.h"
36 #include "VERSION.h"
 
37 #include "json.h"
38 #include <assert.h>
39 #include <time.h>
40
41 #if INTERFACE
42
--- src/json.c
+++ src/json.c
@@ -30,12 +30,12 @@
30 ** dispatch to a JSON-mode-specific command/page handler with the type fossil_json_f().
31 ** See the API docs for that typedef (below) for the semantics of the callbacks.
32 **
33 **
34 */
 
35 #include "VERSION.h"
36 #include "config.h"
37 #include "json.h"
38 #include <assert.h>
39 #include <time.h>
40
41 #if INTERFACE
42
+1
--- src/main.c
+++ src/main.c
@@ -16,10 +16,11 @@
1616
*******************************************************************************
1717
**
1818
** This module codes the main() procedure that runs first when the
1919
** program is invoked.
2020
*/
21
+#include "VERSION.h"
2122
#include "config.h"
2223
#include "main.h"
2324
#include <string.h>
2425
#include <time.h>
2526
#include <fcntl.h>
2627
--- src/main.c
+++ src/main.c
@@ -16,10 +16,11 @@
16 *******************************************************************************
17 **
18 ** This module codes the main() procedure that runs first when the
19 ** program is invoked.
20 */
 
21 #include "config.h"
22 #include "main.h"
23 #include <string.h>
24 #include <time.h>
25 #include <fcntl.h>
26
--- src/main.c
+++ src/main.c
@@ -16,10 +16,11 @@
16 *******************************************************************************
17 **
18 ** This module codes the main() procedure that runs first when the
19 ** program is invoked.
20 */
21 #include "VERSION.h"
22 #include "config.h"
23 #include "main.h"
24 #include <string.h>
25 #include <time.h>
26 #include <fcntl.h>
27
--- src/mkversion.c
+++ src/mkversion.c
@@ -69,7 +69,12 @@
6969
}
7070
}
7171
printf("#define RELEASE_RESOURCE_VERSION %s", vx);
7272
while( d<3 ){ printf(",0"); d++; }
7373
printf("\n");
74
+#if defined(_MSC_VER)
75
+ d = _MSC_VER / 100;
76
+ x = _MSC_VER % 100;
77
+ printf("#define COMPILER_VERSION \"%d.%02d\"\n", d, x);
78
+#endif
7479
return 0;
7580
}
7681
--- src/mkversion.c
+++ src/mkversion.c
@@ -69,7 +69,12 @@
69 }
70 }
71 printf("#define RELEASE_RESOURCE_VERSION %s", vx);
72 while( d<3 ){ printf(",0"); d++; }
73 printf("\n");
 
 
 
 
 
74 return 0;
75 }
76
--- src/mkversion.c
+++ src/mkversion.c
@@ -69,7 +69,12 @@
69 }
70 }
71 printf("#define RELEASE_RESOURCE_VERSION %s", vx);
72 while( d<3 ){ printf(",0"); d++; }
73 printf("\n");
74 #if defined(_MSC_VER)
75 d = _MSC_VER / 100;
76 x = _MSC_VER % 100;
77 printf("#define COMPILER_VERSION \"%d.%02d\"\n", d, x);
78 #endif
79 return 0;
80 }
81
+1
--- src/stat.c
+++ src/stat.c
@@ -16,10 +16,11 @@
1616
*******************************************************************************
1717
**
1818
** This file contains code to implement the stat web page
1919
**
2020
*/
21
+#include "VERSION.h"
2122
#include "config.h"
2223
#include <string.h>
2324
#include "stat.h"
2425
2526
/*
2627
--- src/stat.c
+++ src/stat.c
@@ -16,10 +16,11 @@
16 *******************************************************************************
17 **
18 ** This file contains code to implement the stat web page
19 **
20 */
 
21 #include "config.h"
22 #include <string.h>
23 #include "stat.h"
24
25 /*
26
--- src/stat.c
+++ src/stat.c
@@ -16,10 +16,11 @@
16 *******************************************************************************
17 **
18 ** This file contains code to implement the stat web page
19 **
20 */
21 #include "VERSION.h"
22 #include "config.h"
23 #include <string.h>
24 #include "stat.h"
25
26 /*
27
--- src/style.c
+++ src/style.c
@@ -16,10 +16,11 @@
1616
*******************************************************************************
1717
**
1818
** This file contains code to implement the basic web page look and feel.
1919
**
2020
*/
21
+#include "VERSION.h"
2122
#include "config.h"
2223
#include "style.h"
2324
2425
2526
/*
2627
--- src/style.c
+++ src/style.c
@@ -16,10 +16,11 @@
16 *******************************************************************************
17 **
18 ** This file contains code to implement the basic web page look and feel.
19 **
20 */
 
21 #include "config.h"
22 #include "style.h"
23
24
25 /*
26
--- src/style.c
+++ src/style.c
@@ -16,10 +16,11 @@
16 *******************************************************************************
17 **
18 ** This file contains code to implement the basic web page look and feel.
19 **
20 */
21 #include "VERSION.h"
22 #include "config.h"
23 #include "style.h"
24
25
26 /*
27

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button