Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Side by Side Diff: Python/dynamic_annotations.c

Issue 3871: cross and native build of python for mingw32 with distutils
Patch Set: Created 7 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Python/ceval.c ('k') | Python/errors.c » ('j') | 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) 2008-2009, Google Inc. 1 /* Copyright (c) 2008-2009, Google Inc.
2 * All rights reserved. 2 * All rights reserved.
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 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
11 * contributors may be used to endorse or promote products derived from 11 * contributors may be used to endorse or promote products derived from
12 * this software without specific prior written permission. 12 * this software without specific prior written permission.
13 * 13 *
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 16 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 17 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 * --- 26 * ---
27 * Author: Kostya Serebryany 27 * Author: Kostya Serebryany
28 */ 28 */
29 29
30 #ifdef _MSC_VER 30 #ifdef MS_WINDOWS
31 # include <windows.h> 31 # include <windows.h>
32 #endif 32 #endif
33 33
34 #ifdef __cplusplus 34 #ifdef __cplusplus
35 # error "This file should be built as pure C to avoid name mangling" 35 # error "This file should be built as pure C to avoid name mangling"
36 #endif 36 #endif
37 37
38 #include <stdlib.h> 38 #include <stdlib.h>
39 #include <string.h> 39 #include <string.h>
40 40
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 void AnnotateEnableRaceDetection(const char *file, int line, int enable){} 112 void AnnotateEnableRaceDetection(const char *file, int line, int enable){}
113 void AnnotateNoOp(const char *file, int line, 113 void AnnotateNoOp(const char *file, int line,
114 const volatile void *arg){} 114 const volatile void *arg){}
115 void AnnotateFlushState(const char *file, int line){} 115 void AnnotateFlushState(const char *file, int line){}
116 116
117 static int GetRunningOnValgrind(void) { 117 static int GetRunningOnValgrind(void) {
118 #ifdef RUNNING_ON_VALGRIND 118 #ifdef RUNNING_ON_VALGRIND
119 if (RUNNING_ON_VALGRIND) return 1; 119 if (RUNNING_ON_VALGRIND) return 1;
120 #endif 120 #endif
121 121
122 #ifndef _MSC_VER 122 #ifndef MS_WINDOWS
123 char *running_on_valgrind_str = getenv("RUNNING_ON_VALGRIND"); 123 char *running_on_valgrind_str = getenv("RUNNING_ON_VALGRIND");
124 if (running_on_valgrind_str) { 124 if (running_on_valgrind_str) {
125 return strcmp(running_on_valgrind_str, "0") != 0; 125 return strcmp(running_on_valgrind_str, "0") != 0;
126 } 126 }
127 #else 127 #else
128 /* Visual Studio issues warnings if we use getenv, 128 /* Visual Studio issues warnings if we use getenv,
129 * so we use GetEnvironmentVariableA instead. 129 * so we use GetEnvironmentVariableA instead.
130 */ 130 */
131 char value[100] = "1"; 131 char value[100] = "1";
132 int res = GetEnvironmentVariableA("RUNNING_ON_VALGRIND", 132 int res = GetEnvironmentVariableA("RUNNING_ON_VALGRIND",
(...skipping 12 matching lines...) Expand all
145 static volatile int running_on_valgrind = -1; 145 static volatile int running_on_valgrind = -1;
146 /* C doesn't have thread-safe initialization of statics, and we 146 /* C doesn't have thread-safe initialization of statics, and we
147 don't want to depend on pthread_once here, so hack it. */ 147 don't want to depend on pthread_once here, so hack it. */
148 int local_running_on_valgrind = running_on_valgrind; 148 int local_running_on_valgrind = running_on_valgrind;
149 if (local_running_on_valgrind == -1) 149 if (local_running_on_valgrind == -1)
150 running_on_valgrind = local_running_on_valgrind = GetRunningOnValgrind(); 150 running_on_valgrind = local_running_on_valgrind = GetRunningOnValgrind();
151 return local_running_on_valgrind; 151 return local_running_on_valgrind;
152 } 152 }
153 153
154 #endif /* DYNAMIC_ANNOTATIONS_ENABLED == 1 */ 154 #endif /* DYNAMIC_ANNOTATIONS_ENABLED == 1 */
OLDNEW
« no previous file with comments | « Python/ceval.c ('k') | Python/errors.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+