1
/* Copyright (c) 2009, Google Inc.
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions are
8
* * Redistributions of source code must retain the above copyright
9
* notice, this list of conditions and the following disclaimer.
10
* * Redistributions in binary form must reproduce the above
11
* copyright notice, this list of conditions and the following disclaimer
12
* in the documentation and/or other materials provided with the
14
* * Neither the name of Google Inc. nor the names of its
15
* contributors may be used to endorse or promote products derived from
16
* this software without specific prior written permission.
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
* Author: Craig Silverstein
33
* These are some portability typedefs and defines to make it a bit
34
* easier to compile this code under VC++.
36
* Several of these are taken from glib:
37
* http://developer.gnome.org/doc/API/glib/glib-windows-compatability-functions.html
40
#ifndef GOOGLE_GFLAGS_WINDOWS_PORT_H_
41
#define GOOGLE_GFLAGS_WINDOWS_PORT_H_
43
// You should never include this file directly, but always include it
44
// from either config.h (MSVC) or mingw.h (MinGW/msys).
45
#if !defined(GOOGLE_GFLAGS_WINDOWS_CONFIG_H_)
46
# error "port.h should only be included from config.h"
51
#ifndef WIN32_LEAN_AND_MEAN
52
#define WIN32_LEAN_AND_MEAN /* We always want minimal includes */
55
#include <direct.h> /* for mkdir */
56
#include <stdio.h> /* need this to override stdio's snprintf */
58
#define putenv _putenv
60
// ----------------------------------- STRING ROUTINES
62
// We can't just use _snprintf as a drop-in-replacement, because it
63
// doesn't always NUL-terminate. :-(
64
extern GFLAGS_DLL_DECL int snprintf(char *str, size_t size,
65
const char *format, ...);
67
#define strcasecmp _stricmp
75
#define strtoq _strtoi64
76
#define strtouq _strtoui64
77
#define strtoll _strtoi64
78
#define strtoull _strtoui64
88
#endif /* GOOGLE_GFLAGS_WINDOWS_PORT_H_ */