Build failed on windows with ACE/TAO together
the type definition of uid_t/gid_t/useconds_t are different from ACE and libwebsockets, libwebsockets can control useconds_t with LWS_HAVE_SUSECONDS_T, but can not control uid_t/gid_t. any solution?
C:\vcpkg\installed\x64-windows\include\ace\os_include\sys\os_types.h
#if defined (ACE_LACKS_UID_T)
typedef long uid_t;
#endif /* ACE_LACKS_UID_T */
#if defined (ACE_LACKS_GID_T)
typedef long gid_t;
#endif /* ACE_LACKS_GID_T */
C:\local\include\libwebsockets.h
typedef unsigned int uid_t;
typedef unsigned int gid_t;
typedef unsigned short sa_family_t;
#if !defined(LWS_HAVE_SUSECONDS_T)
typedef unsigned int useconds_t;
typedef int suseconds_t;
#endif
I have no idea what "ACE" is, so, I don't immediately feel that it's my problem to fix whatever is broken. At a minimum, this is something for you to test a fix for and offer a patch.
The stuff you pasted from lws only applies to #if defined(WIN32) which AFAIK doesn't have its own uid_t / gid_t, it seems whatever ACE is, it had the same idea to fake up types for them.
You can try making the lws stuff aware of ACE (also listen to ACE_LACKS_UID_T and skip the lws definitions then). But I think that's something for you to do rather than me to spend my saturday morning running around looking at for $0.
You are totally right, I would have 2 options
- keep aligh the types for uid_t/gid_t which would be good to use long on windows.
- add LWS_HAVE_UID_T / LWS_HAVE_UID_T so user can control while integration.
will have a verify from my side. thanks! nice day!
BTW: ACE
quick fix which works : https://github.com/laoshanxi/libwebsockets/commit/32732696a2bb6c6eeee1c1d41a0fc1f18dbb2d5b