This is the mail archive of the
cygwin
mailing list for the Cygwin project.
wspiapi.h uses _N conflicting with ctype.h
- From: Michael Enright <mike at kmcardiff dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 3 Aug 2015 04:17:44 -0700
- Subject: wspiapi.h uses _N conflicting with ctype.h
- Authentication-results: sourceware.org; auth=none
Here's a reduction of a problem I had compiling v8:
#include <ctype.h>
#include "wspiapi.h"
char array[5];
__wspiapi_countof_helper(array);
The reduction isn't realistic but the problem is real.
On one hand, ctype.h uses _N and it is within its "rights" to do so as
ctype.h is part of the standard library. The statement that uses _N
initially is "#define _N 04", so _N enters the global space of defined
macros.
On the other hand the template __wspiapi_countof_helper uses _N as the
name of one of its parameters. This usage is in the domain of strings
that can be interpreted as references to macros by the preprocessor,
so the _N gets interpreted by the post-preprocessor phases as 04,
causing some distress.
So... the win32 headers are free to use
leading-underscore-capital-letter symbols or no?
Anyway, how can this be addressed?
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple