#define MAKE_SQLSTATE(ch1,ch2,ch3,ch4,ch5) \
((char[]){(char)(ch1),(char)(ch2),(char)(ch3),(char)(ch4),(char)(ch5),(char)'\0'})
I'm pretty sure that's a gcc-ism, not standard C.
Hmm, after some digging: the feature is called compound literals and it was
introduced in c99 although gcc has suppor
Teodor Sigaev writes:
> Following discussion at https://commitfest.postgresql.org/5/190/ patch, I
> found
> (at seems to me) a way to stringify MAKE_SQLSTATE(), the idea is to use char
> array as string:
> #define MAKE_SQLSTATE(ch1,ch2,ch3,ch4,ch5) \
> ((char[]){(char)(ch1),(char)(ch2),(char)(
Hi!
Following discussion at https://commitfest.postgresql.org/5/190/ patch, I found
(at seems to me) a way to stringify MAKE_SQLSTATE(), the idea is to use char
array as string:
#include
#define MAKE_SQLSTATE(ch1,ch2,ch3,ch4,ch5) \
((char[]){(char)(ch1),(char)(ch2),(char)(ch3),(char)(ch4),