blob: aee8d14551d78c959a168417bb78a6d4fb81fae7 [file] [log] [blame]
andrew@webrtc.org076fc122013-02-15 03:54:22 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11// Modified from the Chromium original:
12// src/base/strings/stringize_macros.h
13
andrew@webrtc.org45eab192013-02-13 23:37:14 +000014// This file defines preprocessor macros for stringizing preprocessor
15// symbols (or their output) and manipulating preprocessor symbols
16// that define strings.
17
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020018#ifndef RTC_BASE_STRINGIZE_MACROS_H_
19#define RTC_BASE_STRINGIZE_MACROS_H_
andrew@webrtc.org45eab192013-02-13 23:37:14 +000020
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020021// This is not very useful as it does not expand defined symbols if
22// called directly. Use its counterpart without the _NO_EXPANSION
23// suffix, below.
24#define STRINGIZE_NO_EXPANSION(x) #x
andrew@webrtc.org45eab192013-02-13 23:37:14 +000025
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020026// Use this to quote the provided parameter, first expanding it if it
27// is a preprocessor symbol.
28//
29// For example, if:
30// #define A FOO
31// #define B(x) myobj->FunctionCall(x)
32//
33// Then:
34// STRINGIZE(A) produces "FOO"
35// STRINGIZE(B(y)) produces "myobj->FunctionCall(y)"
36#define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x)
andrew@webrtc.org45eab192013-02-13 23:37:14 +000037
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020038#endif // RTC_BASE_STRINGIZE_MACROS_H_