-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompiler_specific_func.cpp
48 lines (34 loc) · 1.13 KB
/
compiler_specific_func.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// compiler_specific_func.cpp
#include "compiler_specific_func.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Microsoft Visual C++ 6.0
#if defined(_MSC_VER)
// get compiler version string
tstring getCompilerVersionString()
{
TCHAR buf[200];
_sntprintf(buf, NUMBER_OF(buf),
_T("Microsoft (R) 32-bit C/C++ Optimizing Compiler Version %d.%02d"),
_MSC_VER / 100,
_MSC_VER % 100);
return tstring(buf);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Borland C++ 5.5.1
#elif defined(__BORLANDC__)
// get compiler version string
tstring getCompilerVersionString()
{
TCHAR buf[100];
_sntprintf(buf, NUMBER_OF(buf), _T("Borland C++ %d.%d.%d"),
__BORLANDC__ / 0x100,
__BORLANDC__ / 0x10 % 0x10,
__BORLANDC__ % 0x10);
return tstring(buf);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// unknown
#else
# error "I don't know the details of this compiler... Plz hack."
#endif