diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2025-05-08 09:21:45 +0200 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2025-05-08 09:21:45 +0200 |
commit | aacaa3b13bca508cb6cb803d11cb942b2de8c0db (patch) | |
tree | 1fdaa24afcf69c3a0bff205d5f27bfe19498504c | |
parent | 9e85d056cd15befffb39d2f84902d21eda4d98eb (diff) | |
download | gcc-aacaa3b13bca508cb6cb803d11cb942b2de8c0db.zip gcc-aacaa3b13bca508cb6cb803d11cb942b2de8c0db.tar.gz gcc-aacaa3b13bca508cb6cb803d11cb942b2de8c0db.tar.bz2 |
cobol: Don't require GLOB_BRACE etc. [PR119217]
cdf-copy.cc doesn't compile on Solaris:
/vol/gcc/src/hg/master/local/gcc/cobol/cdf-copy.cc: In member function ‘int
copybook_elem_t::open_file(const char*, bool)’:
/vol/gcc/src/hg/master/local/gcc/cobol/cdf-copy.cc:317:34: error:
‘GLOB_BRACE’ was not declared in this scope; did you mean ‘GLOB_ERR’?
317 | static int flags = GLOB_MARK | GLOB_BRACE | GLOB_TILDE;
| ^~~~~~~~~~
| GLOB_ERR
/vol/gcc/src/hg/master/local/gcc/cobol/cdf-copy.cc:317:47: error:
‘GLOB_TILDE’ was not declared in this scope
317 | static int flags = GLOB_MARK | GLOB_BRACE | GLOB_TILDE;
| ^~~~~~~~~~
GLOB_BRACE and GLOB_TILDE are BSD extensions not in POSIX.1, thus
missing on Solaris probably due to its System V heritage.
This patch introduces fallback definitions to avoid this.
Bootstrapped without regressions on amd64-pc-solaris2.11,
sparcv9-sun-solaris2.11, and x86_64-pc-linux-gnu.
2025-04-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/cobol:
PR cobol/119217
* cdf-copy.cc (GLOB_BRACE): Define fallback.
(GLOB_TILDE): Likewise.
-rw-r--r-- | gcc/cobol/cdf-copy.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cobol/cdf-copy.cc b/gcc/cobol/cdf-copy.cc index 2e4bfb6..059596c 100644 --- a/gcc/cobol/cdf-copy.cc +++ b/gcc/cobol/cdf-copy.cc @@ -42,6 +42,16 @@ #include "util.h" #include "copybook.h" +// GLOB_BRACE and GLOB_TILDE are BSD extensions. Provide fallback definitions +// if necessary. +#ifndef GLOB_BRACE +#define GLOB_BRACE 0 +#endif + +#ifndef GLOB_TILDE +#define GLOB_TILDE 0 +#endif + #define COUNT_OF(X) (sizeof(X) / sizeof(X[0])) /* |