1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-13 01:00:23 +02:00

Add STR() macro to create constant String objects from runtime strings.

The STRING_CONST() macro worked fine for constants but was not able to constify strings created at runtime.

Add the STR() macro to do this by using strlen() to get the size.

Also rename STRING_CONST() to STRDEF() for brevity and to match the other macro name.
This commit is contained in:
David Steele
2019-04-16 13:39:58 -04:00
parent a029eba8d5
commit 2dac4b5986
27 changed files with 156 additions and 142 deletions

View File

@ -1,6 +1,7 @@
/***********************************************************************************************************************************
Protocol Parallel Executor
***********************************************************************************************************************************/
#include <string.h>
#include <sys/select.h>
#include "common/debug.h"
@ -182,7 +183,7 @@ protocolParallelProcess(ProtocolParallel *this)
}
CATCH_ANY()
{
protocolParallelJobErrorSet(job, errorCode(), strNew(errorMessage()));
protocolParallelJobErrorSet(job, errorCode(), STR(errorMessage()));
}
TRY_END();