fix logic
[personal-kdelibs.git] / kdecore / kdefakes.h.cmake
blob3c122e24b056ff42e0655a1c6ed78c86723ea477
1 /* This file is part of the KDE libraries
2    Copyright (c) 2006 The KDE Project
4    This library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Library General Public
6    License version 2 as published by the Free Software Foundation.
8    This library is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11    Library General Public License for more details.
13    You should have received a copy of the GNU Library General Public License
14    along with this library; see the file COPYING.LIB.  If not, write to
15    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16    Boston, MA 02110-1301, USA.
19 #ifndef KDEFAKES_H
20 #define KDEFAKES_H
22 /* This file defines the prototypes for a few system calls for platforms which either
23    1) have those system calls, but lack the prototypes in their header files.
24    2) don't have those system calls, in which case kdecore provides those functions.
26    You should include this file in any .cpp file that uses at least one of those functions:
27     strlcat, strlcpy, 
28     strcasestr,
29     setenv, unsetenv, 
30     usleep, initgroups, 
31     random, srandom  (this is for KRandom itself, prefer using KRandom in any other code)
32     mkdtemp (this is for KTempDir itself, prefer using KTempDir everywhere else)
33     mkstemp, mkstemps (prefer to use QTemporaryfile instead)
34     trunc
35    
38 #cmakedefine HAVE_STRLCAT_PROTO 1
39 #if !defined(HAVE_STRLCAT_PROTO)
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 unsigned long strlcat(char*, const char*, unsigned long);
44 #ifdef __cplusplus
46 #endif
47 #endif
49 #cmakedefine HAVE_STRLCPY_PROTO 1
50 #if !defined(HAVE_STRLCPY_PROTO)
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 unsigned long strlcpy(char*, const char*, unsigned long);
55 #ifdef __cplusplus
57 #endif
58 #endif
60 #cmakedefine HAVE_STRCASESTR_PROTO 1
61 #if !defined(HAVE_STRCASESTR_PROTO)
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 char *strcasestr(const char *str1, const char *str2);
66 #ifdef __cplusplus
68 #endif
69 #endif
71 #cmakedefine HAVE_RANDOM_PROTO 1
72 #if !defined(HAVE_RANDOM_PROTO)
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 long int random(void);
77 #ifdef __cplusplus
79 #endif
80 #endif
82 #cmakedefine HAVE_SRANDOM_PROTO 1
83 #if !defined(HAVE_SRANDOM_PROTO)
84 #ifdef __cplusplus
85 extern "C" {
86 #endif
87 void srandom(unsigned int);
88 #ifdef __cplusplus
90 #endif
91 #endif
93 #cmakedefine HAVE_SETENV_PROTO 1
94 #if !defined(HAVE_SETENV_PROTO)
95 #ifdef __cplusplus
96 extern "C" {
97 #endif
98 int setenv (const char *, const char *, int);
99 #ifdef __cplusplus
101 #endif
102 #endif
104 #cmakedefine HAVE_UNSETENV_PROTO 1
105 #if !defined(HAVE_UNSETENV_PROTO)
106 #ifdef __cplusplus
107 extern "C" {
108 #endif
109 int unsetenv (const char *);
110 #ifdef __cplusplus
112 #endif
113 #endif
115 #cmakedefine HAVE_USLEEP_PROTO 1
116 #if !defined(HAVE_USLEEP_PROTO)
117 #ifdef __cplusplus
118 extern "C" {
119 #endif
120 int usleep (unsigned int);
121 #ifdef __cplusplus
123 #endif
124 #endif
126 #cmakedefine HAVE_INITGROUPS_PROTO 1
127 #if !defined(HAVE_INITGROUPS_PROTO)
128 #include <unistd.h>
129 #ifdef __cplusplus
130 extern "C" {
131 #endif
132 int initgroups(const char *, gid_t);
133 #ifdef __cplusplus
135 #endif
136 #endif
138 #cmakedefine HAVE_MKDTEMP_PROTO 1
139 #if !defined(HAVE_MKDTEMP_PROTO)
140 #ifdef __cplusplus
141 extern "C" {
142 #endif
143 char *mkdtemp(char *);
144 #ifdef __cplusplus
146 #endif
147 #endif
149 #cmakedefine HAVE_MKSTEMPS_PROTO 1
150 #if !defined(HAVE_MKSTEMPS_PROTO)
151 #ifdef __cplusplus
152 extern "C" {
153 #endif
154 int mkstemps(char *, int);
155 #ifdef __cplusplus
157 #endif
158 #endif
160 #cmakedefine HAVE_MKSTEMP_PROTO 1
161 #if !defined(HAVE_MKSTEMP_PROTO)
162 #ifdef __cplusplus
163 extern "C" {
164 #endif
165 int mkstemp(char *);
166 #ifdef __cplusplus
168 #endif
169 #endif
171 #cmakedefine HAVE_TRUNC 1
172 #if !defined(HAVE_TRUNC)
173 #ifdef __cplusplus
174 extern "C" {
175 #endif
176 double trunc(double);
177 #ifdef __cplusplus
179 #endif
180 #endif
182 #endif /* KDEFAKES_H */