libwebsockets icon indicating copy to clipboard operation
libwebsockets copied to clipboard

Build failed on windows with ACE/TAO together

Open laoshanxi opened this issue 1 month ago • 3 comments

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

laoshanxi avatar Nov 15 '25 06:11 laoshanxi

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.

lws-team avatar Nov 15 '25 06:11 lws-team

You are totally right, I would have 2 options

  1. keep aligh the types for uid_t/gid_t which would be good to use long on windows.
  2. 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

laoshanxi avatar Nov 15 '25 07:11 laoshanxi

quick fix which works : https://github.com/laoshanxi/libwebsockets/commit/32732696a2bb6c6eeee1c1d41a0fc1f18dbb2d5b

laoshanxi avatar Nov 15 '25 08:11 laoshanxi