Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1408d5d

Browse files
committed
Get rid of useless/dangerous redefinition of bool in ECPG.
pgtypeslib_extern.h contained fallback definitions of "bool", "FALSE",and "TRUE". The latter two are just plain unused, and have been forawhile. The former came into play only if there wasn't a macrodefinition of "bool", which is true only if we aren't using <stdbool.h>.However, it then defined bool as "char"; since commitd26a810 thatconflicts with c.h's desire to use "unsigned char". We'd missed seeingany bad effects of that due to accidental header inclusion order choices,butdddf4cd exposed that it was problematic.To fix, let's just get rid of these definitions. They should not beneeded because everyplace in Postgres should be relying on c.h toprovide a definition for type bool. (Note that despite its name,pgtypeslib_extern.h isn't exposed to any outside code; we don'tinstall it.)This doesn't fully resolve the issue, because ecpglib.h is doingsimilar things, but that seems to require more thought to fix.Back-patch to v12 whered26a810 came in, to forestall any unpleasantsurprises from future back-patched bug fixes.Discussion:https://postgr.es/m/CAA4eK1LmaKO7Du9M9Lo=kxGU8sB6aL8fa3sF6z6d5yYYVe3BuQ@mail.gmail.com
1 parent22f6f2c commit1408d5d

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

‎src/interfaces/ecpg/pgtypeslib/pgtypeslib_extern.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,4 @@ intpgtypes_fmt_replace(union un_fmt_comb, int, char **, int *);
3838
char*pgtypes_alloc(long);
3939
char*pgtypes_strdup(constchar*);
4040

41-
#ifndefbool
42-
#definebool char
43-
#endif/* ndef bool */
44-
45-
#ifndefFALSE
46-
#defineFALSE0
47-
#endif/* FALSE */
48-
49-
#ifndefTRUE
50-
#defineTRUE 1
51-
#endif/* TRUE */
52-
5341
#endif/* _ECPG_PGTYPESLIB_EXTERN_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp