1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-04-27 12:12:18 +02:00

25 lines
1.6 KiB
C
Raw Normal View History

/***********************************************************************************************************************************
General Macros
***********************************************************************************************************************************/
#ifndef COMMON_MACRO_H
#define COMMON_MACRO_H
/***********************************************************************************************************************************
Convert the parameter to a zero-terminated string
This is useful for converting non-string types (e.g. int) to strings for inclusion in messages.
***********************************************************************************************************************************/
#define STRINGIFY_HELPER(param) #param
#define STRINGIFY(param) STRINGIFY_HELPER(param)
/***********************************************************************************************************************************
Glue together a string/macro and another string//macro
Useful for creating function names when one or both of the macro parameter needs to be converted to a macro before concatenating.
common/object.h has numerous examples of this.
***********************************************************************************************************************************/
#define GLUE_HELPER(param1, param2) param1##param2
#define GLUE(param1, param2) GLUE_HELPER(param1, param2)
#endif