uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 267 forks source link

"src/internal/internal.h:119:5: error: unknown type name 'uint32_t'" When building with boost.asio #197

Closed Madahin closed 1 year ago

Madahin commented 1 year ago

Description

When building with WITH_ASIO=1 flag, the build fail with the error

src/internal/internal.h:119:5: error: unknown type name 'uint32_t'
  119 |     uint32_t global_tick;
      |     ^~~~~~~~

Step to reproduce

In the master branch (commit as time of writing is 5d1d640)

WITH_ASIO=1 make

Log

madahin /tmp/uSockets master ❯ LANG=en WITH_ASIO=1 make
rm -f *.o
cc -flto -DLIBUS_NO_SSL -DLIBUS_USE_ASIO -std=c11 -Isrc -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
In file included from src/bsd.c:23:
src/internal/internal.h:119:5: error: unknown type name 'uint32_t'
  119 |     uint32_t global_tick;
      |     ^~~~~~~~
In file included from src/context.c:19:
src/internal/internal.h:119:5: error: unknown type name 'uint32_t'
  119 |     uint32_t global_tick;
      |     ^~~~~~~~
In file included from src/loop.c:19:
src/internal/internal.h:119:5: error: unknown type name 'uint32_t'
  119 |     uint32_t global_tick;
      |     ^~~~~~~~
In file included from src/socket.c:19:
src/internal/internal.h:119:5: error: unknown type name 'uint32_t'
  119 |     uint32_t global_tick;
      |     ^~~~~~~~
In file included from src/udp.c:19:
src/internal/internal.h:119:5: error: unknown type name 'uint32_t'
  119 |     uint32_t global_tick;
      |     ^~~~~~~~
In file included from src/eventing/epoll_kqueue.c:19:
src/internal/internal.h:119:5: error: unknown type name 'uint32_t'
  119 |     uint32_t global_tick;
      |     ^~~~~~~~
In file included from src/eventing/gcd.c:19:
src/internal/internal.h:119:5: error: unknown type name 'uint32_t'
  119 |     uint32_t global_tick;
      |     ^~~~~~~~
In file included from src/eventing/libuv.c:19:
src/internal/internal.h:119:5: error: unknown type name 'uint32_t'
  119 |     uint32_t global_tick;
      |     ^~~~~~~~
make: *** [Makefile:66: default] Error 1

The log is also attached here

System

Linux with the stock (but recompiled with march=native) archlinux kernel uname -a :

Linux BLOUMECIA 6.2.0-arch1-1_ryzen5 #1 SMP PREEMPT_DYNAMIC Tue, 21 Feb 2023 11:57:44 +0000 x86_64 GNU/Linux

gcc -v :

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.1 20230201 (GCC)