s_version.h revision 2e9e9eca83c3dee85b7815573a8cf1e6d1780741
1/**
2 * Copyright(c) 2011 Trusted Logic.   All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 *  * Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 *  * Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in
12 *    the documentation and/or other materials provided with the
13 *    distribution.
14 *  * Neither the name Trusted Logic nor the names of its
15 *    contributors may be used to endorse or promote products derived
16 *    from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30#ifndef __S_VERSION_H__
31#define __S_VERSION_H__
32
33/*
34 * Usage: define S_VERSION_BUILD on the compiler's command line.
35 *
36 * Then set:
37 * - S_VERSION_OS
38 * - S_VERSION_PLATFORM
39 * - S_VERSION_MAIN
40 * - S_VERSION_ENG is optional
41 * - S_VERSION_PATCH is optional
42 * - S_VERSION_BUILD = 0 if S_VERSION_BUILD not defined or empty
43 */
44#if defined(WIN32)
45#define S_VERSION_OS "W"          /* "W" for Windows PC (XP, Vista�) */
46#define S_VERSION_PLATFORM "X"    /* "X" for ix86 PC simulators */
47#elif defined(__ANDROID32__)
48#define S_VERSION_OS "A"          /* "A" for Android */
49#define S_VERSION_PLATFORM "G"    /* "G" for 4430 */
50#elif defined(LINUX)
51#define S_VERSION_OS "L"          /* "L" for Linux */
52#define S_VERSION_PLATFORM "X"    /* "X" for ix86 PC simulators */
53#else
54#define S_VERSION_OS "X"          /* "X" for Secure-World */
55#define S_VERSION_PLATFORM "G"    /* "G" for 4430 */
56#endif
57
58/*
59 * This version number must be updated for each new release
60 */
61#define S_VERSION_MAIN  "01.04"
62#define S_VERSION_RESOURCE 1,4,0,S_VERSION_BUILD
63
64/*
65* If this is a patch or engineering version use the following
66* defines to set the version number. Else set these values to 0.
67*/
68#define S_VERSION_PATCH 11
69#define S_VERSION_ENG 0
70
71#ifdef S_VERSION_BUILD
72/* TRICK: detect if S_VERSION is defined but empty */
73#if 0 == S_VERSION_BUILD-0
74#undef  S_VERSION_BUILD
75#define S_VERSION_BUILD 0
76#endif
77#else
78/* S_VERSION_BUILD is not defined */
79#define S_VERSION_BUILD 0
80#endif
81
82#define __STRINGIFY(X) #X
83#define __STRINGIFY2(X) __STRINGIFY(X)
84
85#if S_VERSION_ENG != 0
86#define _S_VERSION_ENG "e" __STRINGIFY2(S_VERSION_ENG)
87#else
88#define _S_VERSION_ENG ""
89#endif
90
91#if S_VERSION_PATCH != 0
92#define _S_VERSION_PATCH "p" __STRINGIFY2(S_VERSION_PATCH)
93#else
94#define _S_VERSION_PATCH ""
95#endif
96
97#if !defined(NDEBUG) || defined(_DEBUG)
98#define S_VERSION_VARIANT "D   "
99#else
100#define S_VERSION_VARIANT "    "
101#endif
102
103#define S_VERSION_STRING \
104	"SMC" \
105	S_VERSION_OS \
106	S_VERSION_PLATFORM \
107	S_VERSION_MAIN \
108	_S_VERSION_PATCH \
109	_S_VERSION_ENG \
110	"."  __STRINGIFY2(S_VERSION_BUILD) " " \
111	S_VERSION_VARIANT
112
113#endif /* __S_VERSION_H__ */
114