Bit-Genie icon indicating copy to clipboard operation
Bit-Genie copied to clipboard

Fix missing include

Open skiminki opened this issue 1 year ago • 0 comments

network.h uses fixed-width integer types without including <cstdint>, causing a compilation error on Ubuntu 23.10 (GCC 13.2). Fix this.

Bench: 1877660


The error in question is:

g++ -DEVALFILE=\"defaultnet.nn\" -std=c++17 -Wall -Wextra -O3 -DNDEBUG -flto -march=native *.cpp -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -o Bit-Genie 
In file included from position.h:19,
                 from history.h:21,
                 from search.h:21,
                 from benchmark.cpp:19:
network.h:54:17: error: 'uint32_t' in namespace 'std' does not name a type; did you mean 'wint_t'?
   54 |     static std::uint32_t get_hash() {
      |                 ^~~~~~~~
      |                 wint_t

repeated couple of times.

Note: Including <stdint.h> didn't work for me, since that doesn't add the typedefs in namespace std.

In general, it would likely be better to include <cstdint> (and similar) instead of the respective C headers.

skiminki avatar Sep 05 '23 14:09 skiminki