GNU CommonC++
missing.h
Go to the documentation of this file.
1 // Copyright (C) 1999-2005 Open Source Telecom Corporation.
2 //
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // This program 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
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 //
17 // As a special exception, you may use this file as part of a free software
18 // library without restriction. Specifically, if other files instantiate
19 // templates or use macros or inline functions from this file, or you compile
20 // this file and link it with other files to produce an executable, this
21 // file does not by itself cause the resulting executable to be covered by
22 // the GNU General Public License. This exception does not however
23 // invalidate any other reasons why the executable file might be covered by
24 // the GNU General Public License.
25 //
26 // This exception applies only to the code released under the name GNU
27 // Common C++. If you copy code from other releases into a copy of GNU
28 // Common C++, as the General Public License permits, the exception does
29 // not apply to the code that you add in this way. To avoid misleading
30 // anyone as to the status of such modified files, you must delete
31 // this exception notice from them.
32 //
33 // If you write modifications of your own for GNU Common C++, it is your choice
34 // whether to permit this exception to apply to your modifications.
35 // If you do not wish that, delete this exception notice.
36 //
37 
43 #ifndef CCXX_MISSING_H_
44 #define CCXX_MISSING_H_
45 
46 #ifndef CCXX_CONFIG_H_
47 #include <cc++/config.h>
48 #endif
49 
50 #ifndef CCXX_STRCHAR_H_
51 #include <cc++/strchar.h>
52 #endif
53 
54 #include <ctime>
55 
56 #ifdef MACOSX
57 #undef HAVE_LOCKF
58 #endif
59 
60 #ifdef WIN32
61 #ifndef HAVE_LOCKF
62 #define HAVE_LOCKF
63 #endif
64 #endif
65 
66 #include <fstream>
67 #include <iostream>
68 #include <ctime>
69 
70 #ifdef HAVE_SSTREAM
71 #include <sstream>
72 #else
73 #include <strstream>
74 #endif
75 
76 #if defined(__KCC)
77 #define ostream ostream_withassign
78 #endif
79 
80 #ifdef __BORLANDC__
81 #include <time.h>
82 #endif
83 
84 #ifdef CCXX_NAMESPACES
85 namespace ost {
86 #endif
87 
88 #ifndef HAVE_GETTIMEOFDAY
89 #ifdef WIN32
90 #define HAVE_GETTIMEOFDAY
91 __EXPORT int gettimeofday(struct timeval *tv_, void *tz_);
92 #endif
93 #endif
94 
95 #ifdef HAVE_GETTIMEOFDAY
96 #ifdef WIN32
97 __EXPORT DWORD getTicks(void);
98 #else
99 __EXPORT unsigned long getTicks(void);
100 #endif
101 #endif
102 
103 #ifndef HAVE_MEMMOVE
104 __EXPORT void *memmove(char *dest, const char *source, size_t length);
105 #endif
106 
107 #ifndef HAVE_STRDUP
108 __EXPORT char *strdup(const char *str);
109 #endif
110 
111 #ifndef HAVE_LOCKF
112 __EXPORT int lockf(int fd, int mode, long offset);
113 #endif
114 
115 #ifndef HAVE_STRTOK_R
116 
117 inline char *strtok_r(char *s, const char *d, char **x) \
118  {return strtok(s, d);};
119 
120 #endif
121 
122 #ifdef CCXX_NAMESPACES
123 }
124 #endif
125 
126 #endif