Initial revision
[TestXSLT.git] / libsablot / src / engine / platform.h
1 /*
2  * The contents of this file are subject to the Mozilla Public
3  * License Version 1.1 (the "License"); you may not use this file
4  * except in compliance with the License. You may obtain a copy of
5  * the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS
8  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9  * implied. See the License for the specific language governing
10  * rights and limitations under the License.
11  *
12  * The Original Code is the Sablotron XSLT Processor.
13  *
14  * The Initial Developer of the Original Code is Ginger Alliance Ltd.
15  * Portions created by Ginger Alliance are Copyright (C) 2000-2002
16  * Ginger Alliance Ltd. All Rights Reserved.
17  *
18  * Contributor(s):
19  *
20  * Alternatively, the contents of this file may be used under the
21  * terms of the GNU General Public License Version 2 or later (the
22  * "GPL"), in which case the provisions of the GPL are applicable
23  * instead of those above.  If you wish to allow use of your
24  * version of this file only under the terms of the GPL and not to
25  * allow others to use your version of this file under the MPL,
26  * indicate your decision by deleting the provisions above and
27  * replace them with the notice and other provisions required by
28  * the GPL.  If you do not delete the provisions above, a recipient
29  * may use your version of this file under either the MPL or the
30  * GPL.
31  */
32
33 // platform.h
34
35 #if !defined(PlatformHIncl)
36 #define PlatformHIncl
37
38 #ifdef HAVE_CONFIG_H
39 #include <config.h>
40 #endif
41
42 #ifdef HAVE_ICONV_H
43 #include <iconv.h>
44 #else
45 #undef iconv_t
46 typedef void* iconv_t;
47 #endif
48
49 #ifdef HAVE_SYS_TYPES_H
50 #include <sys/types.h> // needed too in Windows
51 #endif
52
53 // GP: clean
54
55 //misc combined defines
56 #if defined(_MSC_VER) || (defined(HAVE_WCSXFRM) && defined(HAVE_WCSCMP))
57 #define SAB_WCS_COLLATE 1
58 #endif
59
60 // disable the "no placement delete" warning of MSVC 6
61 // (MSVC 4.2 doesn't accept placement deletes)
62 #if defined(WIN32)
63 #pragma warning(disable: 4291)
64 // some more warnings we don't care about
65 #pragma warning(disable: 4514 4100 4512)
66 #endif
67
68 extern int isnan__(double x);
69 extern int isinf__(double x);
70 extern double getMillisecs();
71 extern int wcscmp__(const char* a, const char* b);
72 extern void setlinebuf__(FILE *file);
73
74 class DStr;
75 void my_getcwd(DStr &dir);
76
77 #endif
78
79 #if defined(WIN32)
80 #define snprintf _snprintf
81 #define strncasecmp _strnicmp
82 #else
83 #include <strings.h>            // definition of strncasecmp
84 #endif