#206 Include incompatibility with Xerces in Cygwin

Anything_Else
open
5
2004-12-22
2004-12-10
Anonymous
No

In Cygwin, if any Xerces headers are included before
cc++ headers, a lot of compile time errors result.

On closer inspection, the Xerces Autosense.hpp has this:

...
#if defined(_WIN32) || defined(WIN32) || defined
(__CYGWIN__)
#define XML_WIN32
#ifndef WIN32
#define WIN32
#endif
#elif
...

Here, the only symbol defined is __CYGWIN__, resulting
in the definition of WIN32.

If WIN32 is defined before the inclusion of , say
<cc++/threads.h>, a whole heap of errors are generated.

C:/cygwin/usr/local/include/cc++2/cc++/thread.h:98:
error: syntax error before `;' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:99:
error: syntax error before `;' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:211:
error: 'HANDLE' is used as a type, but is not defined as a
type.
C:/cygwin/usr/local/include/cc++2/cc++/thread.h: In
member function `int ost::AtomicCounter::operator++()':
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:445:
error: `InterlockedIncrement' undeclared (first use this
function)
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:445:
error: (Each undeclared identifier is reported only once
for each function it appears in.)
C:/cygwin/usr/local/include/cc++2/cc++/thread.h: In
member function `int ost::AtomicCounter::operator--()':
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:448:
error: `InterlockedDecrement' undeclared (first use this
function)
C:/cygwin/usr/local/include/cc++2/cc++/thread.h: In
member function `int ost::AtomicCounter::operator=
(int)':
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:461:
error: `InterlockedExchange' undeclared (first use this
function)
C:/cygwin/usr/local/include/cc++2/cc++/thread.h: At
global scope:
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:554:
error: 'HANDLE' is used as a type, but is not defined as a
type.
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:652:
error: 'HANDLE' is used as a type, but is not defined as a
type.
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:681:
error: `timeout_t' was not declared in this scope
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:681:
error: parse error before `)' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:941:
error: `HANDLE' was not declared in this scope
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:941:
error: parse error before `,' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1134:
error: `timeout_t' was not declared in this scope
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1134:
error: parse error before `)' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1230:
error: parse error before `)' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1270:
error: ISO C++ forbids declaration of `DWORD' with no
type
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1270:
error: parse error before `(' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1445:
error: 'DWORD' is used as a type, but is not defined as a
type.
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1490:
error: 'DWORD' is used as a type, but is not defined as a
type.
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1511:
error: `timeout_t' was not declared in this scope
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1511:
error: parse error before `=' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1522:
error: `timeout_t' was not declared in this scope
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1522:
error: parse error before `)' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1542:
error: parse error before `)' token
C:/cygwin/usr/local/include/cc++2/cc++/thread.h:1553:
error: parse error before `)' token

Discussion

  • David Sugar

    David Sugar - 2004-12-22
    • assigned_to: nobody --> dyfet
    • status: open --> open-postponed
     
  • David Sugar

    David Sugar - 2004-12-22

    Logged In: YES
    user_id=217

    We do something similar to "autosense"...

    Hmm...

    The very first cc++ header actually included would normally be "cc++/
    config.h", which gets pulled through as needed. Perhaps something could
    be added there to assure if __CYGWIN is defind, WIN32 never is defined.
    At one time we considered having CYGWIN compile native w32 threading
    calls rather than going through the extra emulation of cygwin libpthread,
    since the native w32 build supports this anyway.

     

Log in to post a comment.