Skip to content

Commit a82a174

Browse files
committed
Silence warnings about redefining popen on Mingw-w64.
Mingw-w64 headers map popen/pclose to _popen and _pclose, but we want to use our popen wrapper rather than the Mingw-w64. #undef the Mingw's version.
1 parent 4773c70 commit a82a174

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/include/port.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,18 @@ extern FILE *pgwin32_fopen(const char *, const char *);
301301
#define fopen(a,b) pgwin32_fopen(a,b)
302302
#endif
303303

304+
/*
305+
* Mingw-w64 headers #define popen and pclose to _popen and _pclose. We want
306+
* to use our popen wrapper, rather than plain _popen, so override that. For
307+
* consistency, use our version of pclose, too.
308+
*/
309+
#ifdef popen
310+
#undef popen
311+
#endif
312+
#ifdef pclose
313+
#undef pclose
314+
#endif
315+
304316
/*
305317
* system() and popen() replacements to enclose the command in an extra
306318
* pair of quotes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy