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

Side by Side Diff: src/platform-win32.cc

Issue 7308007: MinGW32: define STRUNCATE (Closed)
Patch Set: Created 9 years, 5 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
« no previous file with comments | « no previous file | 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 int fopen_s(FILE** pFile, const char* filename, const char* mode) { 140 int fopen_s(FILE** pFile, const char* filename, const char* mode) {
141 *pFile = fopen(filename, mode); 141 *pFile = fopen(filename, mode);
142 return *pFile != NULL ? 0 : 1; 142 return *pFile != NULL ? 0 : 1;
143 } 143 }
144 144
145 145
146 int _vsnprintf_s(char* buffer, size_t sizeOfBuffer, size_t count, 146 int _vsnprintf_s(char* buffer, size_t sizeOfBuffer, size_t count,
147 const char* format, va_list argptr) { 147 const char* format, va_list argptr) {
148 return _vsnprintf(buffer, sizeOfBuffer, format, argptr); 148 return _vsnprintf(buffer, sizeOfBuffer, format, argptr);
149 } 149 }
150 #define _TRUNCATE 0
151 150
152 151
153 int strncpy_s(char* strDest, size_t numberOfElements, 152 int strncpy_s(char* strDest, size_t numberOfElements,
154 const char* strSource, size_t count) { 153 const char* strSource, size_t count) {
155 strncpy(strDest, strSource, count); 154 strncpy(strDest, strSource, count);
Vyacheslav Egorov (Chromium) 2011/07/05 13:46:51 This implementation is not safe and is not followi
156 return 0; 155 return 0;
157 } 156 }
158 157
158 #define _TRUNCATE 0
159 #define STRUNCATE 80
160
159 161
160 inline void MemoryBarrier() { 162 inline void MemoryBarrier() {
161 int barrier = 0; 163 int barrier = 0;
162 __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier)); 164 __asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier));
163 } 165 }
164 166
165 #endif // __MINGW32__ 167 #endif // __MINGW32__
166 168
167 // Generate a pseudo-random number in the range 0-2^31-1. Usually 169 // Generate a pseudo-random number in the range 0-2^31-1. Usually
168 // defined in stdlib.h. Missing in both Microsoft Visual Studio C++ and MinGW. 170 // defined in stdlib.h. Missing in both Microsoft Visual Studio C++ and MinGW.
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 2010
2009 void Sampler::Stop() { 2011 void Sampler::Stop() {
2010 ASSERT(IsActive()); 2012 ASSERT(IsActive());
2011 SamplerThread::RemoveActiveSampler(this); 2013 SamplerThread::RemoveActiveSampler(this);
2012 SetActive(false); 2014 SetActive(false);
2013 } 2015 }
2014 2016
2015 #endif // ENABLE_LOGGING_AND_PROFILING 2017 #endif // ENABLE_LOGGING_AND_PROFILING
2016 2018
2017 } } // namespace v8::internal 2019 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698