Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: runtime/platform/globals.h

Issue 9139011: Handle EINTR on all IO operations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed building on Mac OS Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/socket_macos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 21 matching lines...) Expand all
32 #include <float.h> 32 #include <float.h>
33 #include <limits.h> 33 #include <limits.h>
34 #include <math.h> 34 #include <math.h>
35 #include <openssl/bn.h> 35 #include <openssl/bn.h>
36 #include <stdarg.h> 36 #include <stdarg.h>
37 #include <stddef.h> 37 #include <stddef.h>
38 #include <stdio.h> 38 #include <stdio.h>
39 #include <stdlib.h> 39 #include <stdlib.h>
40 #include <string.h> 40 #include <string.h>
41 #include <sys/types.h> 41 #include <sys/types.h>
42 #include <unistd.h>
42 43
43 #if defined(_WIN32) 44 #if defined(_WIN32)
44 #include "platform/c99_support_win.h" 45 #include "platform/c99_support_win.h"
45 #include "platform/inttypes_support_win.h" 46 #include "platform/inttypes_support_win.h"
46 #endif 47 #endif
47 48
48 49
49 // Target OS detection. 50 // Target OS detection.
50 // for more information on predefined macros: 51 // for more information on predefined macros:
51 // - http://msdn.microsoft.com/en-us/library/b0084kay.aspx 52 // - http://msdn.microsoft.com/en-us/library/b0084kay.aspx
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 static inline void USE(T) { } 96 static inline void USE(T) { }
96 97
97 98
98 // On Windows the reentrent version of strtok is called 99 // On Windows the reentrent version of strtok is called
99 // strtok_s. Unify on the posix name strtok_r. 100 // strtok_s. Unify on the posix name strtok_r.
100 #if defined(TARGET_OS_WINDOWS) 101 #if defined(TARGET_OS_WINDOWS)
101 #define snprintf _snprintf 102 #define snprintf _snprintf
102 #define strtok_r strtok_s 103 #define strtok_r strtok_s
103 #endif 104 #endif
104 105
106 #if !defined(TARGET_OS_WINDOWS) && !defined(TEMP_FAILURE_RETRY)
107 // TEMP_FAILURE_RETRY is defined in unistd.h on some platforms. The
108 // definition below is copied from Linux and adapted to avoid lint
109 // errors (type long int changed to int64_t and do/while split on
110 // separate lines with body in {}s).
111 # define TEMP_FAILURE_RETRY(expression) \
112 ({ int64_t __result; \
113 do { \
114 __result = (int64_t) (expression); \
115 } while (__result == -1L && errno == EINTR); \
116 __result; })
117 #endif
118
105 #endif // PLATFORM_GLOBALS_H_ 119 #endif // PLATFORM_GLOBALS_H_
OLDNEW
« no previous file with comments | « runtime/bin/socket_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698