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

Commit382092a

Browse files
committed
Prevent redeclaration of typedef yyscan_t
Fix for1f0de66: We need to prevent redeclaration of typedefyyscan_t. (This will work with C11 but not currently with C99.) Thegenerated scanner files provide their own typedef, but we also need toprovide one for the interfaces that we expose. So we need to add somepreprocessor guards to avoid a redefinition. (This is how thegenerated scanner files do it internally as well.) This wayeverything now works independent of the order in which things areincluded.Discussion:https://www.postgresql.org/message-id/flat/eb6faeac-2a8a-4b69-9189-c33c520e5b7b@eisentraut.org
1 parent9aea73f commit382092a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

‎contrib/cube/cubedata.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ typedef struct NDBOX
6262
/* for cubescan.l and cubeparse.y */
6363
/* All grammar constructs return strings */
6464
#defineYYSTYPE char *
65+
#ifndefYY_TYPEDEF_YY_SCANNER_T
66+
#defineYY_TYPEDEF_YY_SCANNER_T
6567
typedefvoid*yyscan_t;
68+
#endif
6669

6770
/* in cubescan.l */
6871
externintcube_yylex(YYSTYPE*yylval_param,yyscan_tyyscanner);

‎contrib/seg/segdata.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ extern intsignificant_digits(const char *s);
1616

1717
/* for segscan.l and segparse.y */
1818
unionYYSTYPE;
19+
#ifndefYY_TYPEDEF_YY_SCANNER_T
20+
#defineYY_TYPEDEF_YY_SCANNER_T
1921
typedefvoid*yyscan_t;
22+
#endif
2023

2124
/* in segscan.l */
2225
externintseg_yylex(unionYYSTYPE*yylval_param,yyscan_tyyscanner);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp