monotone

monotone Mtn Source Tree

Root/netxx/compat.h

1/*
2 * compat.h - Compatibility header
3 *
4 * Copyright (C) 2002-2004 Isaac W. Foraker (isaac(at)tazthecat.net)
5 * All Rights Reserved
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * 3. Neither the name of the Author nor the names of its contributors
18 * may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
29 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 * Purpose:
34 *Very few compilers are fully standards compliant. This header is an
35 *attempt to tweak settings on individual compiler environments to make
36 *standard code more portable.
37 *
38 */
39
40#ifndef _compat_h_compatability_header_
41#define _compat_h_compatability_header_
42
43#ifdef __cplusplus // Only work for C++ sources
44
45// Import common standard library functions into the std namespace on Microsoft
46// Visual C++ 6 or earlier, but only if not already running with the STLPort
47// fix.
48#if defined(_MSC_VER) && _MSC_VER <= 1200 && !defined(_STLP_DO_IMPORT_CSTD_FUNCTIONS)
49#include <cstdio>
50#include <cstdlib>
51#include <cstring>
52#include <cctype>
53#include <ctime>
54namespace std {
55using ::atoi;using ::atof;
56using ::isalpha; using ::isdigit; using ::isalnum; using ::isgraph; using ::isspace;
57using ::islower; using ::isupper; using ::isxdigit; using ::ispunct; using ::isprint;
58using ::iscntrl; using ::toupper; using ::tolower;
59using ::sprintf; using ::printf; using ::sscanf; using ::scanf;
60using ::size_t; using ::time_t;
61using ::strlen;using ::strcmp; using ::strncmp; using ::strcpy; using ::strncpy;
62using ::memset; using ::memcpy; using ::memcmp;
63using ::malloc; using ::free;
64using ::clock; using ::time; using ::asctime; using ::gmtime; using ::localtime;
65}
66#endif
67
68// Disable some annoying MSVC++ warnings.
69#if defined(_MSC_VER)
70#if _MSC_VER <= 1200
71// Older version of MSVC do not support throw() declaration
72#pragma warning(disable : 4290)
73#endif
74// Turn off warnings for long symbol names caused by the STL
75#pragma warning(disable : 4786)
76#endif
77
78
79#endif // __cplusplus
80
81
82#endif // _compat_h__compatability_header

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status