| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PLATFORM_GLOBALS_H_ | 5 #ifndef PLATFORM_GLOBALS_H_ |
| 6 #define PLATFORM_GLOBALS_H_ | 6 #define PLATFORM_GLOBALS_H_ |
| 7 | 7 |
| 8 // __STDC_FORMAT_MACROS has to be defined to enable platform independent printf. | 8 // __STDC_FORMAT_MACROS has to be defined to enable platform independent printf. |
| 9 #ifndef __STDC_FORMAT_MACROS | 9 #ifndef __STDC_FORMAT_MACROS |
| 10 #define __STDC_FORMAT_MACROS | 10 #define __STDC_FORMAT_MACROS |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #if defined(_WIN32) | 13 #if defined(_WIN32) |
| 14 // Cut down on the amount of stuff that gets included via windows.h. | 14 // Cut down on the amount of stuff that gets included via windows.h. |
| 15 #define WIN32_LEAN_AND_MEAN | 15 #define WIN32_LEAN_AND_MEAN |
| 16 #define NOMINMAX | 16 #define NOMINMAX |
| 17 #define NOKERNEL | 17 #define NOKERNEL |
| 18 #define NOUSER | 18 #define NOUSER |
| 19 #define NOSERVICE | 19 #define NOSERVICE |
| 20 #define NOSOUND | 20 #define NOSOUND |
| 21 #define NOMCX | 21 #define NOMCX |
| 22 | 22 |
| 23 #include <windows.h> | 23 #include <windows.h> |
| 24 #include <Rpc.h> | 24 #include <Rpc.h> |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 #if !defined(_WIN32) | 27 #if !defined(_WIN32) |
| 28 #include <inttypes.h> | 28 #include <inttypes.h> |
| 29 #include <stdint.h> | 29 #include <stdint.h> |
| 30 #include <unistd.h> |
| 30 #endif | 31 #endif |
| 31 | 32 |
| 32 #include <float.h> | 33 #include <float.h> |
| 33 #include <limits.h> | 34 #include <limits.h> |
| 34 #include <math.h> | 35 #include <math.h> |
| 35 #include <openssl/bn.h> | 36 #include <openssl/bn.h> |
| 36 #include <stdarg.h> | 37 #include <stdarg.h> |
| 37 #include <stddef.h> | 38 #include <stddef.h> |
| 38 #include <stdio.h> | 39 #include <stdio.h> |
| 39 #include <stdlib.h> | 40 #include <stdlib.h> |
| 40 #include <string.h> | 41 #include <string.h> |
| 41 #include <sys/types.h> | 42 #include <sys/types.h> |
| 42 #include <unistd.h> | |
| 43 | 43 |
| 44 #if defined(_WIN32) | 44 #if defined(_WIN32) |
| 45 #include "platform/c99_support_win.h" | 45 #include "platform/c99_support_win.h" |
| 46 #include "platform/inttypes_support_win.h" | 46 #include "platform/inttypes_support_win.h" |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 | 49 |
| 50 // Target OS detection. | 50 // Target OS detection. |
| 51 // for more information on predefined macros: | 51 // for more information on predefined macros: |
| 52 // - http://msdn.microsoft.com/en-us/library/b0084kay.aspx | 52 // - http://msdn.microsoft.com/en-us/library/b0084kay.aspx |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // separate lines with body in {}s). | 110 // separate lines with body in {}s). |
| 111 # define TEMP_FAILURE_RETRY(expression) \ | 111 # define TEMP_FAILURE_RETRY(expression) \ |
| 112 ({ int64_t __result; \ | 112 ({ int64_t __result; \ |
| 113 do { \ | 113 do { \ |
| 114 __result = (int64_t) (expression); \ | 114 __result = (int64_t) (expression); \ |
| 115 } while (__result == -1L && errno == EINTR); \ | 115 } while (__result == -1L && errno == EINTR); \ |
| 116 __result; }) | 116 __result; }) |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 #endif // PLATFORM_GLOBALS_H_ | 119 #endif // PLATFORM_GLOBALS_H_ |
| OLD | NEW |