Skip to content

Commit 2391208

Browse files
committed
Code portability improvement
1 parent 34e1b75 commit 2391208

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

src/types.hpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,16 @@ limitations under the License.
184184
typedef unsigned __int64 uint64_t;
185185
#endif
186186
#else
187-
typedef signed char int8_t;
188-
typedef signed short int16_t;
189-
typedef signed int int32_t;
190-
typedef unsigned char uint8_t;
191-
typedef unsigned short uint16_t;
192-
typedef unsigned int uint32_t;
193-
194-
#if !defined(__APPLE__)
195-
typedef signed long int64_t;
196-
typedef unsigned long uint64_t;
187+
// If stdint.h did not provide fixed-width types, define them here.
188+
#ifndef INT64_MAX
189+
typedef signed char int8_t;
190+
typedef signed short int16_t;
191+
typedef signed int int32_t;
192+
typedef unsigned char uint8_t;
193+
typedef unsigned short uint16_t;
194+
typedef unsigned int uint32_t;
195+
typedef signed long long int64_t;
196+
typedef unsigned long long uint64_t;
197197
#endif
198198
#endif
199199

@@ -266,4 +266,3 @@ limitations under the License.
266266
#endif
267267

268268
#endif
269-

0 commit comments

Comments
 (0)