| OLD | NEW |
| 1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 // Author: sesse@google.com (Steinar H. Gunderson) | 2 // Author: sesse@google.com (Steinar H. Gunderson) |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 // | 29 // |
| 30 // Various type stubs for the open-source version of Snappy. | 30 // Various type stubs for the open-source version of Snappy. |
| 31 // | 31 // |
| 32 // This file cannot include config.h, as it is included from snappy.h, | 32 // This file cannot include config.h, as it is included from snappy.h, |
| 33 // which is a public header. Instead, snappy-stubs-public.h is generated by | 33 // which is a public header. Instead, snappy-stubs-public.h is generated by |
| 34 // from snappy-stubs-public.h.in at configure time. | 34 // from snappy-stubs-public.h.in at configure time. |
| 35 | 35 |
| 36 #ifndef UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ | 36 #ifndef THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ |
| 37 #define UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ | 37 #define THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ |
| 38 | 38 |
| 39 #if 0 | 39 #if 1 |
| 40 #include <stdint.h> | 40 #include <stdint.h> |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 #if 1 | 43 #if 1 |
| 44 #include <stddef.h> | 44 #include <stddef.h> |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 #if 0 | 47 #if 0 |
| 48 #include <sys/uio.h> | 48 #include <sys/uio.h> |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 #define SNAPPY_MAJOR 1 | 51 #define SNAPPY_MAJOR 1 |
| 52 #define SNAPPY_MINOR 1 | 52 #define SNAPPY_MINOR 1 |
| 53 #define SNAPPY_PATCHLEVEL 0 | 53 #define SNAPPY_PATCHLEVEL 4 |
| 54 #define SNAPPY_VERSION \ | 54 #define SNAPPY_VERSION \ |
| 55 ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) | 55 ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) |
| 56 | 56 |
| 57 #include <string> | 57 #include <string> |
| 58 | 58 |
| 59 namespace snappy { | 59 namespace snappy { |
| 60 | 60 |
| 61 #if 0 | 61 #if 1 |
| 62 typedef int8_t int8; | 62 typedef int8_t int8; |
| 63 typedef uint8_t uint8; | 63 typedef uint8_t uint8; |
| 64 typedef int16_t int16; | 64 typedef int16_t int16; |
| 65 typedef uint16_t uint16; | 65 typedef uint16_t uint16; |
| 66 typedef int32_t int32; | 66 typedef int32_t int32; |
| 67 typedef uint32_t uint32; | 67 typedef uint32_t uint32; |
| 68 typedef int64_t int64; | 68 typedef int64_t int64; |
| 69 typedef uint64_t uint64; | 69 typedef uint64_t uint64; |
| 70 #else | 70 #else |
| 71 typedef signed char int8; | 71 typedef signed char int8; |
| 72 typedef unsigned char uint8; | 72 typedef unsigned char uint8; |
| 73 typedef short int16; | 73 typedef short int16; |
| 74 typedef unsigned short uint16; | 74 typedef unsigned short uint16; |
| 75 typedef int int32; | 75 typedef int int32; |
| 76 typedef unsigned int uint32; | 76 typedef unsigned int uint32; |
| 77 typedef long long int64; | 77 typedef long long int64; |
| 78 typedef unsigned long long uint64; | 78 typedef unsigned long long uint64; |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 typedef std::string string; | 81 typedef std::string string; |
| 82 | 82 |
| 83 #ifndef DISALLOW_COPY_AND_ASSIGN | 83 #ifndef DISALLOW_COPY_AND_ASSIGN |
| 84 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ | 84 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ |
| 85 TypeName(const TypeName&); \ | 85 TypeName(const TypeName&); \ |
| 86 void operator=(const TypeName&) | 86 void operator=(const TypeName&) |
| 87 #endif | 87 #endif |
| 88 | 88 |
| 89 #if 1 | 89 #if !0 |
| 90 // Windows does not have an iovec type, yet the concept is universally useful. | 90 // Windows does not have an iovec type, yet the concept is universally useful. |
| 91 // It is simple to define it ourselves, so we put it inside our own namespace. | 91 // It is simple to define it ourselves, so we put it inside our own namespace. |
| 92 struct iovec { | 92 struct iovec { |
| 93 void* iov_base; | 93 void* iov_base; |
| 94 size_t iov_len; | 94 size_t iov_len; |
| 95 }; | 95 }; |
| 96 #endif | 96 #endif |
| 97 | 97 |
| 98 // MSVC does not have ssize_t by default; autoconf suggests defining as `int'. | |
| 99 // Would be in config.h, but Chromium does not use automake/autoconf. | |
| 100 #include <Windows.h> | |
| 101 #include <BaseTsd.h> | |
| 102 typedef SSIZE_T ssize_t; | |
| 103 | |
| 104 } // namespace snappy | 98 } // namespace snappy |
| 105 | 99 |
| 106 #endif // UTIL_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ | 100 #endif // THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_STUBS_PUBLIC_H_ |
| OLD | NEW |