]>
Dogcows Code - chaz/yoink/blob - src/stlplus/portability/build.cpp
1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004 onwards
6 // License: BSD License, see ../docs/license.html
8 // report the platform-specific details of this build
10 ////////////////////////////////////////////////////////////////////////////////
12 #include "version.hpp"
13 #include "dprintf.hpp"
14 ////////////////////////////////////////////////////////////////////////////////
19 // STLplus version in the form "STLplus v3.0" - see version.hpp for a way of getting just the version number
20 std::string
stlplus_version(void)
22 return std::string("STLplus v") + version();
25 // platform is the target operating system in the form "Windows" or "Generic Unix"
26 std::string
platform(void)
29 return std::string("Windows");
31 // at present there are no variations between different Unix platforms so
32 // they all map onto the generic Unix platform
33 return std::string("Generic Unix");
37 // compiler_name is the short name of the compiler, e.g. "gcc" or "MSVC"
38 std::string
compiler_name(void)
41 return std::string("gcc");
42 #elif defined _MSC_VER
43 return std::string("MSVC");
44 #elif defined __BORLANDC__
45 return std::string("Borland");
47 return std::string("unknown compiler");
51 // compiler_version is the version string of the compiler e.g. "3.4" for gcc or "15.00" for MSVC
52 std::string
compiler_version(void)
55 return dformat("%d.%d.%d",__GNUC__
,__GNUC_MINOR__
,__GNUC_PATCHLEVEL__
);
56 #elif defined _MSC_VER
57 return dformat("%0.2f",((float)_MSC_VER
)/100.0);
58 #elif defined __BORLANDC__
59 return dformat("%d.%d%d",__BORLANDC__
/256,__BORLANDC__
/16%16
,__BORLANDC__%16
);
65 // compiler is the compilation system and version above combined into a human- readable form e.g. "gcc v3.4"
66 std::string
compiler(void)
68 return compiler_name() + std::string(" v") + compiler_version();
71 // variant is the kind of build - "debug" or "release"
72 std::string
variant(void)
75 return std::string("debug");
77 return std::string("release");
82 std::string
build(void)
84 return stlplus_version() + ", " + platform() + ", " + compiler() + ", " + variant();
87 ////////////////////////////////////////////////////////////////////////////////
88 } // end namespace stlplus
This page took 0.038086 seconds and 5 git commands to generate.