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

Unified Diff: base/port.h

Issue 160191: Move base::va_copy from a function to a macro. (Closed)
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/string_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/port.h
diff --git a/base/port.h b/base/port.h
index d077705bd8f63fe62c7927287dd39c9f9a2a3a67..3dad79f41f723accd6e338275ddd4ce5f1f8286b 100644
--- a/base/port.h
+++ b/base/port.h
@@ -32,23 +32,17 @@
#define GG_UINT32_C(x) (x ## U)
#define GG_UINT64_C(x) GG_ULONGLONG(x)
-namespace base {
-
// It's possible for functions that use a va_list, such as StringPrintf, to
// invalidate the data in it upon use. The fix is to make a copy of the
// structure before using it and use that copy instead. va_copy is provided
// for this purpose. MSVC does not provide va_copy, so define an
// implementation here. It is not guaranteed that assignment is a copy, so the
// StringUtil.VariableArgsFunc unit test tests this capability.
-inline void va_copy(va_list& a, va_list& b) {
#if defined(COMPILER_GCC)
- ::va_copy(a, b);
+#define GG_VA_COPY(a, b) (::va_copy(a, b))
Mark Mentovai 2009/07/27 21:07:30 You don't need the :: any longer.
#elif defined(COMPILER_MSVC)
- a = b;
+#define GG_VA_COPY(a, b) (a = b)
#endif
-}
-
-} // namespace base
// Define an OS-neutral wrapper for shared library entry points
#if defined(OS_WIN)
« no previous file with comments | « no previous file | base/string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698