Skip to content

Commit 1628440

Browse files
authored
Set NA to GCC Version in Windows (#536)
1 parent dce31f8 commit 1628440

File tree

6 files changed

+24
-15
lines changed

6 files changed

+24
-15
lines changed

messages/bin_ltfsck/root.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ root:table {
129129
16087E:string { "Volume is inconsistent. Try to recover consistency with ltfsck first." }
130130
16088I:string { "Launched by \"%s\"." }
131131
16089I:string { "%s." }
132-
16090I:string { "GCC version is %s." }
132+
16090I:string { "%s version is %s." }
133133
16091E:string { "Cannot recover missing EOD (%d)." }
134134
16092E:string { "Cannot set up tape drive (%s)." }
135135
16093E:string { "Cannot recover the cartridge with ltfsck." }

messages/bin_mkltfs/root.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ root:table {
8080
15040I:string { "Medium unformatted successfully." }
8181
15041I:string { "Launched by \"%s\"." }
8282
15042I:string { "%s." }
83-
15043I:string { "GCC version is %s." }
83+
15043I:string { "%s version is %s." }
8484
15044E:string { "Cannot set up tape device." }
8585
15045E:string { "Formatting was canceled by the user." }
8686
15046E:string { "Unformatting was canceled by the user." }

src/libltfs/arch/arch_info.h

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,49 +50,58 @@
5050
#ifndef arch_info_h_
5151
#define arch_info_h_
5252

53+
#if defined(_MSC_VER)
54+
#define BUILD_SYS_COMPILER "MSVC"
55+
#else
56+
#define BUILD_SYS_COMPILER "GCC"
57+
#endif
58+
5359
#if defined(__linux__)
5460

5561
#if defined(__i386__)
5662
#define BUILD_SYS_FOR "This binary is built for Linux (i386)"
57-
#define BUILD_SYS_GCC __VERSION__
63+
#define BUILD_SYS_COMPILER_VER __VERSION__
5864
#elif defined(__x86_64__)
5965
#define BUILD_SYS_FOR "This binary is built for Linux (x86_64)"
60-
#define BUILD_SYS_GCC __VERSION__
66+
#define BUILD_SYS_COMPILER_VER __VERSION__
6167
#elif defined(__ppc__)
6268
#define BUILD_SYS_FOR "This binary is built for Linux (ppc)"
63-
#define BUILD_SYS_GCC __VERSION__
69+
#define BUILD_SYS_COMPILER_VER __VERSION__
6470
#elif defined(__ppc64__)
6571
#define BUILD_SYS_FOR "This binary is built for Linux (ppc64)"
66-
#define BUILD_SYS_GCC __VERSION__
72+
#define BUILD_SYS_COMPILER_VER __VERSION__
6773
#else
6874
#define BUILD_SYS_FOR "This binary is built for Linux (unknown)"
69-
#define BUILD_SYS_GCC __VERSION__
75+
#define BUILD_SYS_COMPILER_VER __VERSION__
7076
#endif
7177

7278
#elif defined(__APPLE__)
7379

7480
#define BUILD_SYS_FOR "This binary is built for Mac OS X "
75-
#define BUILD_SYS_GCC __VERSION__
81+
#define BUILD_SYS_COMPILER_VER __VERSION__
7682

7783
#elif defined(__FreeBSD__)
7884

7985
#define BUILD_SYS_FOR "This binary is built for FreeBSD"
80-
#define BUILD_SYS_GCC __VERSION__
86+
#define BUILD_SYS_COMPILER_VER __VERSION__
8187

8288
#elif defined(__NetBSD__)
8389

8490
#define BUILD_SYS_FOR "This binary is built for NetBSD"
85-
#define BUILD_SYS_GCC __VERSION__
91+
#define BUILD_SYS_COMPILER_VER __VERSION__
8692

8793
#elif defined(mingw_PLATFORM)
8894

95+
#define STR_HELPER(x) #x
96+
#define STR_MACRO(x) STR_HELPER(x)
97+
8998
#define BUILD_SYS_FOR "This binary is built for Windows"
90-
#define BUILD_SYS_GCC __VERSION__
99+
#define BUILD_SYS_COMPILER_VER STR_MACRO(_MSC_VER)
91100

92101
#else
93102

94103
#define BUILD_SYS_FOR "This binary is built on an unknown OS"
95-
#define BUILD_SYS_GCC __VERSION__
104+
#define BUILD_SYS_COMPILER_VER __VERSION__
96105

97106
#endif
98107

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ int main(int argc, char **argv)
695695

696696
/* Show build time information */
697697
ltfsmsg(LTFS_INFO, 14105I, BUILD_SYS_FOR);
698-
ltfsmsg(LTFS_INFO, 14106I, BUILD_SYS_GCC);
698+
ltfsmsg(LTFS_INFO, 14106I, BUILD_SYS_COMPILER_VER);
699699

700700
/* Show run time information */
701701
show_runtime_system_info();

src/utils/ltfsck.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ int main(int argc, char **argv)
481481

482482
/* Show build time information */
483483
ltfsmsg(LTFS_INFO, 16089I, BUILD_SYS_FOR);
484-
ltfsmsg(LTFS_INFO, 16090I, BUILD_SYS_GCC);
484+
ltfsmsg(LTFS_INFO, 16090I, BUILD_SYS_COMPILER, BUILD_SYS_COMPILER_VER);
485485

486486
/* Show run time information */
487487
show_runtime_system_info();

src/utils/mkltfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ int main(int argc, char **argv)
454454

455455
/* Show build time information */
456456
ltfsmsg(LTFS_INFO, 15042I, BUILD_SYS_FOR);
457-
ltfsmsg(LTFS_INFO, 15043I, BUILD_SYS_GCC);
457+
ltfsmsg(LTFS_INFO, 15043I, BUILD_SYS_COMPILER, BUILD_SYS_COMPILER_VER);
458458

459459
/* Show run time information */
460460
show_runtime_system_info();

0 commit comments

Comments
 (0)