34 #ifndef GRPCXX_CONFIG_H
35 #define GRPCXX_CONFIG_H
37 #if !defined(GRPC_NO_AUTODETECT_PLATFORM)
42 #error "gRPC is only supported with Visual Studio starting at 2010"
45 #define GRPC_CXX0X_NO_FINAL 1
46 #define GRPC_CXX0X_NO_OVERRIDE 1
47 #define GRPC_CXX0X_NO_CHRONO 1
48 #define GRPC_CXX0X_NO_THREAD 1
50 #endif // Visual Studio
55 #if (__GNUC__ * 100 + __GNUC_MINOR__ < 406)
56 #define GRPC_CXX0X_NO_NULLPTR 1
59 #if (__GNUC__ * 100 + __GNUC_MINOR__ < 407)
60 #define GRPC_CXX0X_NO_FINAL 1
61 #define GRPC_CXX0X_NO_OVERRIDE 1
68 #ifdef GRPC_CXX0X_NO_FINAL
71 #define GRPC_FINAL final
74 #ifdef GRPC_CXX0X_NO_OVERRIDE
77 #define GRPC_OVERRIDE override
80 #ifndef GRPC_CUSTOM_PROTOBUF_INT64
81 #include <google/protobuf/stubs/common.h>
82 #define GRPC_CUSTOM_PROTOBUF_INT64 ::google::protobuf::int64
85 #ifndef GRPC_CUSTOM_MESSAGE
86 #include <google/protobuf/message.h>
87 #define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message
90 #ifndef GRPC_CUSTOM_STRING
92 #define GRPC_CUSTOM_STRING std::string
95 #ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM
96 #include <google/protobuf/io/coded_stream.h>
97 #include <google/protobuf/io/zero_copy_stream.h>
98 #define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM \
99 ::google::protobuf::io::ZeroCopyOutputStream
100 #define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM \
101 ::google::protobuf::io::ZeroCopyInputStream
102 #define GRPC_CUSTOM_CODEDINPUTSTREAM \
103 ::google::protobuf::io::CodedInputStream
107 #ifdef GRPC_CXX0X_NO_NULLPTR
111 template <
class T>
operator T*()
const {
return static_cast<T *
>(0);}
112 template <
class T>
operator std::unique_ptr<T>()
const {
113 return std::unique_ptr<T>(
static_cast<T *
>(0));
115 operator bool()
const {
return false;}
117 void operator&()
const =
delete;
123 typedef GRPC_CUSTOM_STRING string;
127 typedef GRPC_CUSTOM_MESSAGE Message;
128 typedef GRPC_CUSTOM_PROTOBUF_INT64 int64;
131 typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream;
132 typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream;
133 typedef GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream;
140 #endif // GRPCXX_CONFIG_H