summaryrefslogtreecommitdiff
path: root/src/port/sys_internal.h
blob: f5a010c3b4b5d4bdf0f1ef2452b8ab74b40ba619 (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
 *  sqlite3xx - sqlite3 C++ layer, following the ideas of libpqxx
 *  Copyright (C) 2009  Andreas Baumann
 *
 *  This copyrighted material is made available to anyone wishing to use,
 *  modify, copy, or redistribute it subject to the terms and conditions of
 *  the GNU Lesser General Public License, as published by the Free Software
 *  Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY
 *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 *  License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this distribution; if not, write to:
 *  Free Software Foundation, Inc.
 *  51 Franklin Street, Fifth Floor
 *  Boston, MA  02110-1301  USA
 *
 */

#ifndef SQLITE3XX_SYS_INTERNAL_H
#define SQLITE3XX_SYS_INTERNAL_H

#if defined LINUX
#if OS_MAJOR_VERSION == 2
#if OS_MINOR_VERSION == 6
#define _XOPEN_SOURCE 600
#define HAVE_STRDUP
#else
	#error unknown platform
#endif /* defined OS_MINOR_VERSION == 6 */
#else
#if OS_MAJOR_VERSION == 3
#if OS_MINOR_VERSION >= 0 && OS_MINOR_VERSION <= 14
#define _XOPEN_SOURCE 600
#define HAVE_STRDUP
#else
        #error unknown platform
#endif /* defined OS_MINOR_VERSION == 0 */
#else
	#error unknown platform
#endif /* defined OS_MAJOR_VERSION == 3 */
#endif /* defined OS_MAJOR_VERSION == 2 */
#endif /* defined LINUX */

#if defined FREEBSD
#if OS_MAJOR_VERSION == 7
#if OS_MINOR_VERSION >= 0 && OS_MINOR_VERSION <= 2
#define _XOPEN_SOURCE 600
#define HAVE_STRDUP
#else
	#error unknown platform
#endif /* defined OS_MINOR_VERSION >= 0 && OS_MINOR_VERSION <= 2 */
#else
#if OS_MAJOR_VERSION == 6
#if OS_MINOR_VERSION == 2
#define _XOPEN_SOURCE 600
#define HAVE_STRDUP
#else
	#error unknown platform
#endif /* defined OS_MINOR_VERSION == 2 */
#else
	#error unknown platform
#endif /* defined OS_MAJOR_VERSION == 6 */
#endif /* defined OS_MAJOR_VERSION == 7 */
#endif /* defined FREEBSD */

#if defined OPENBSD
#if OS_MAJOR_VERSION == 4
#if OS_MINOR_VERSION >= 2 && OS_MINOR_VERSION <= 5
#define _XOPEN_SOURCE 600
#define HAVE_STRDUP
#else
	#error unknown platform
#endif /* defined OS_MINOR_VERSION >= 2 && OS_MINOR_VERSION <= 3 */
#else
	#error unknown platform
#endif /* defined OS_MAJOR_VERSION == 4 */
#endif /* defined OPENBSD */

#if defined NETBSD
#if OS_MAJOR_VERSION == 5
#if OS_MINOR_VERSION == 0
/* don't enable XOPEN_SOURCE here, we get compatibility problems
 * with libstdc++: vgwscanf undefined
 */
#define HAVE_STRDUP
#else
	#error unknown platform
#endif /* defined OS_MINOR_VERSION == 2 */
#else /* defined OS_MAJOR_VERSION == 4 */

#if OS_MAJOR_VERSION == 4
#if OS_MINOR_VERSION == 0
#define _XOPEN_SOURCE 600
#define HAVE_STRDUP
#else
	#error unknown platform
#endif /* defined OS_MINOR_VERSION == 2 */
#else
	#error unknown platform
#endif /* defined OS_MAJOR_VERSION == 4 */
#endif /* defined OS_MAJOR_VERSION == 5 */
#endif /* defined NETBSD */

#if defined SUNOS
#if OS_MAJOR_VERSION == 5
#if OS_MINOR_VERSION == 8
#if !defined __cplusplus
#define _XOPEN_SOURCE 600
#define __EXTENSIONS__
#endif
#define HAVE_STRDUP
#else
#if OS_MINOR_VERSION == 10
#if !defined __cplusplus 
#define _XOPEN_SOURCE 600
#define __EXTENSIONS__
#endif
#define HAVE_STRDUP
#else
	#error unknown platform
#endif /* OS_MINOR_VERSION == 10 */
#endif /* OS_MINOR_VERSION == 8 */
#else
	#error unknown platform
#endif /* OS_MAJOR_VERSION == 5 */
#endif /* defined SUNOS */

#if defined CYGWIN
#if OS_MAJOR_VERSION == 5
#if OS_MINOR_VERSION >= 0 && OS_MINOR_VERSION <= 1
#define _XOPEN_SOURCE 600
#else
	#error unknown platform
#endif /* OS_MINOR_VERSION >= 0 && OS_MINOR_VERSION <= 1 */
#else
	#error unknown platform
#endif /* OS_MAJOR_VERSION == 5 */
#endif /* defined CYGWIN */

#endif /* ifndef SQLITE3XX_SYS_INTERNAL_H */