OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Platform-specific code for Win32. | 5 // Platform-specific code for Win32. |
6 | 6 |
7 // Secure API functions are not available using MinGW with msvcrt.dll | 7 // Secure API functions are not available using MinGW with msvcrt.dll |
8 // on Windows XP. Make sure MINGW_HAS_SECURE_API is not defined to | 8 // on Windows XP. Make sure MINGW_HAS_SECURE_API is not defined to |
9 // disable definition of secure API functions in standard headers that | 9 // disable definition of secure API functions in standard headers that |
10 // would conflict with our own implementation. | 10 // would conflict with our own implementation. |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 inline void MemoryBarrier() { | 40 inline void MemoryBarrier() { |
41 int barrier = 0; | 41 int barrier = 0; |
42 __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier)); | 42 __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier)); |
43 } | 43 } |
44 | 44 |
45 #endif // __MINGW64_VERSION_MAJOR | 45 #endif // __MINGW64_VERSION_MAJOR |
46 | 46 |
47 | 47 |
48 int localtime_s(tm* out_tm, const time_t* time) { | 48 int localtime_s(tm* out_tm, const time_t* time) { |
49 tm* posix_local_time_struct = localtime(time); | 49 tm* posix_local_time_struct = localtime(time); // NOLINT |
50 if (posix_local_time_struct == NULL) return 1; | 50 if (posix_local_time_struct == NULL) return 1; |
51 *out_tm = *posix_local_time_struct; | 51 *out_tm = *posix_local_time_struct; |
52 return 0; | 52 return 0; |
53 } | 53 } |
54 | 54 |
55 | 55 |
56 int fopen_s(FILE** pFile, const char* filename, const char* mode) { | 56 int fopen_s(FILE** pFile, const char* filename, const char* mode) { |
57 *pFile = fopen(filename, mode); | 57 *pFile = fopen(filename, mode); |
58 return *pFile != NULL ? 0 : 1; | 58 return *pFile != NULL ? 0 : 1; |
59 } | 59 } |
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 | 1379 |
1380 | 1380 |
1381 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 1381 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
1382 BOOL result = TlsSetValue(static_cast<DWORD>(key), value); | 1382 BOOL result = TlsSetValue(static_cast<DWORD>(key), value); |
1383 USE(result); | 1383 USE(result); |
1384 DCHECK(result); | 1384 DCHECK(result); |
1385 } | 1385 } |
1386 | 1386 |
1387 } // namespace base | 1387 } // namespace base |
1388 } // namespace v8 | 1388 } // namespace v8 |
OLD | NEW |