X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fstringify.h;fp=include%2Flttng%2Fstringify.h;h=b8dfd90cbc5c60ed62af6e49f04f142424328fe3;hb=4318ae1be57eb7983ab4857a7a8eeb4a030a8216;hp=0000000000000000000000000000000000000000;hpb=d4419b81b243bc3a6bdd4a09b3ca2216d044a1c7;p=ust.git diff --git a/include/lttng/stringify.h b/include/lttng/stringify.h new file mode 100644 index 0000000..b8dfd90 --- /dev/null +++ b/include/lttng/stringify.h @@ -0,0 +1,29 @@ +#ifndef __LINUX_STRINGIFY_H +#define __LINUX_STRINGIFY_H +/* + * Copyright (C) 2009 Zhaolei + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* Indirect stringification. Doing two levels allows the parameter to be a + * macro itself. For example, compile with -DFOO=bar, __stringify(FOO) + * converts to "bar". + */ + +#define __stringify_1(x...) #x +#define __stringify(x...) __stringify_1(x) + +#endif /* !__LINUX_STRINGIFY_H */