Update vendor/ for the last commit
[debiancodesearch.git] / vendor / github.com / apache / thrift / compiler / cpp / src / thrift / windows / config.h
blob5f057ca818af89efc9b8cbf80691bea7603fee6f
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
20 #ifndef _THRIFT_WINDOWS_CONFIG_H_
21 #define _THRIFT_WINDOWS_CONFIG_H_ 1
23 #if defined(_MSC_VER) && (_MSC_VER > 1200)
24 #pragma once
25 #endif // _MSC_VER
27 #ifndef _WIN32
28 #error "This is a Windows header only"
29 #endif
31 #include <io.h>
32 #include <stdlib.h>
33 #include <direct.h>
35 #define strtoll(begin_ptr, end_ptr, length) _strtoi64(begin_ptr, end_ptr, length)
37 #define PRIu64 "I64d"
38 #define PRIi64 "I64d"
40 // squelch deprecation warnings
41 #pragma warning(disable : 4996)
42 // squelch bool conversion performance warning
43 #pragma warning(disable : 4800)
45 // MSVC10 (2010) or later has stdint.h
46 #if _MSC_VER >= 1600
47 #define HAVE_STDINT_H 1
48 #endif
50 // Must be using VS2010 or later, or boost, so that C99 types are defined in the global namespace
51 #ifdef HAVE_STDINT_H
52 #include <stdint.h>
53 #else
54 #include <boost/cstdint.hpp>
56 typedef boost::int64_t int64_t;
57 typedef boost::uint64_t uint64_t;
58 typedef boost::int32_t int32_t;
59 typedef boost::uint32_t uint32_t;
60 typedef boost::int16_t int16_t;
61 typedef boost::uint16_t uint16_t;
62 typedef boost::int8_t int8_t;
63 typedef boost::uint8_t uint8_t;
64 #endif
66 #endif // _THRIFT_WINDOWS_CONFIG_H_