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

Side by Side Diff: src/core/SkString.cpp

Issue 1051273004: Avoid defining snprintf when MSVC provides it Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | src/pdf/SkPDFTypes.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkString.h" 10 #include "SkString.h"
11 #include "SkFixed.h" 11 #include "SkFixed.h"
12 #include "SkThread.h" 12 #include "SkThread.h"
13 #include "SkUtils.h" 13 #include "SkUtils.h"
14 #include <stdarg.h> 14 #include <stdarg.h>
15 #include <stdio.h> 15 #include <stdio.h>
16 16
17 // number of bytes (on the stack) to receive the printf result 17 // number of bytes (on the stack) to receive the printf result
18 static const size_t kBufferSize = 1024; 18 static const size_t kBufferSize = 1024;
19 19
20 #ifdef SK_BUILD_FOR_WIN 20 #if defined(_MSC_VER) && _MSC_VER < 1900
21 #define VSNPRINTF(buffer, size, format, args) \ 21 #define VSNPRINTF(buffer, size, format, args) \
22 _vsnprintf_s(buffer, size, _TRUNCATE, format, args) 22 _vsnprintf_s(buffer, size, _TRUNCATE, format, args)
23 #define SNPRINTF _snprintf 23 #define SNPRINTF _snprintf
24 #else 24 #else
25 #define VSNPRINTF vsnprintf 25 #define VSNPRINTF vsnprintf
26 #define SNPRINTF snprintf 26 #define SNPRINTF snprintf
27 #endif 27 #endif
28 28
29 #define ARGS_TO_BUFFER(format, buffer, size, written) \ 29 #define ARGS_TO_BUFFER(format, buffer, size, written) \
30 do { \ 30 do { \
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 const size_t len = strcspn(str, delimiters); 656 const size_t len = strcspn(str, delimiters);
657 out->push_back().set(str, len); 657 out->push_back().set(str, len);
658 str += len; 658 str += len;
659 // Skip any delimiters. 659 // Skip any delimiters.
660 str += strspn(str, delimiters); 660 str += strspn(str, delimiters);
661 } 661 }
662 } 662 }
663 663
664 #undef VSNPRINTF 664 #undef VSNPRINTF
665 #undef SNPRINTF 665 #undef SNPRINTF
OLDNEW
« no previous file with comments | « no previous file | src/pdf/SkPDFTypes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698