| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium 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 // This file defines preprocessor macros for stringizing preprocessor | 5 // This file defines preprocessor macros for stringizing preprocessor |
| 6 // symbols (or their output) and manipulating preprocessor symbols | 6 // symbols (or their output) and manipulating preprocessor symbols |
| 7 // that define strings. | 7 // that define strings. |
| 8 | 8 |
| 9 #ifndef BASE_STRINGIZE_MACROS_H_ | 9 #ifndef BASE_STRINGIZE_MACROS_H_ |
| 10 #define BASE_STRINGIZE_MACROS_H_ | 10 #define BASE_STRINGIZE_MACROS_H_ |
| 11 #pragma once | |
| 12 | 11 |
| 13 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 14 | 13 |
| 15 // This is not very useful as it does not expand defined symbols if | 14 // This is not very useful as it does not expand defined symbols if |
| 16 // called directly. Use its counterpart without the _NO_EXPANSION | 15 // called directly. Use its counterpart without the _NO_EXPANSION |
| 17 // suffix, below. | 16 // suffix, below. |
| 18 #define STRINGIZE_NO_EXPANSION(x) #x | 17 #define STRINGIZE_NO_EXPANSION(x) #x |
| 19 | 18 |
| 20 // Use this to quote the provided parameter, first expanding it if it | 19 // Use this to quote the provided parameter, first expanding it if it |
| 21 // is a preprocessor symbol. | 20 // is a preprocessor symbol. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 48 // For example, if: | 47 // For example, if: |
| 49 // #define C "foo" | 48 // #define C "foo" |
| 50 // | 49 // |
| 51 // Then: | 50 // Then: |
| 52 // TO_L_STRING(C) produces L"foo" | 51 // TO_L_STRING(C) produces L"foo" |
| 53 #define TO_L_STRING(x) TO_L_STRING_NO_EXPANSION(x) | 52 #define TO_L_STRING(x) TO_L_STRING_NO_EXPANSION(x) |
| 54 | 53 |
| 55 #endif // defined(OS_WIN) | 54 #endif // defined(OS_WIN) |
| 56 | 55 |
| 57 #endif // BASE_STRINGIZE_MACROS_H_ | 56 #endif // BASE_STRINGIZE_MACROS_H_ |
| OLD | NEW |