SOCI / soci

Official repository of the SOCI - The C++ Database Access Library
http://soci.sourceforge.net/
Boost Software License 1.0
1.37k stars 472 forks source link

postgresql: Fix missing include #1146

Closed h3xx closed 2 months ago

h3xx commented 2 months ago

Fixes FTBFS seen when using GCC 13.2.0.

It was complaining about not seeing std::int32_t and this include fixes it.

Compiling version ce0630b2cd348bced6533eb3a18250a113f6748e on Linux x86_64.

CMake options used:

mkdir _build; cd _build; cmake
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -DCMAKE_INSTALL_MANDIR='man' \
    -DCMAKE_INSTALL_INFODIR='info' \
    -DBUILD_SHARED_LIBS=ON \
    -DCMAKE_EXE_LINKER_FLAGS='-s' \
    -DCMAKE_GENERATOR='Unix Makefiles' \
    -DCMAKE_VERBOSE_MAKEFILE=OFF \
    -DCMAKE_COLOR_MAKEFILE=ON \
    -DCMAKE_BUILD_TYPE='Release' \
    -DSOCI_TESTS=OFF \
    -DSOCI_STATIC=OFF \
    -DWITH_FIREBIRD=OFF \
    -DWITH_MYSQL=OFF \
    -DWITH_ORACLE=OFF \
    -DWITH_DB2=OFF \
    -DSOCI_CXX11=ON \
    ..
Full error message follows (~41 lines): ``` /tmp/git/soci/src/backends/postgresql/blob.cpp: In member function 'virtual std::size_t soci::postgresql_blob_backend::read_from_start(void*, std::size_t, std::size_t)': /tmp/git/soci/src/backends/postgresql/blob.cpp:77:60: error: 'int32_t' is not a member of 'std'; did you mean 'int32_t'? 77 | const std::size_t batchSize = std::numeric_limits::max(); | ^~~~~~~ In file included from /usr/include/sys/types.h:155, from /usr/include/stdlib.h:514, from /usr/include/c++/13.2.0/cstdlib:79, from /usr/include/c++/13.2.0/ext/string_conversions.h:43, from /usr/include/c++/13.2.0/bits/basic_string.h:4097, from /usr/include/c++/13.2.0/string:54, from /tmp/git/soci/include/soci/soci-platform.h:18, from /tmp/git/soci/include/soci/postgresql/soci-postgresql.h:12, from /tmp/git/soci/src/backends/postgresql/blob.cpp:9: /usr/include/bits/stdint-intn.h:26:19: note: 'int32_t' declared here 26 | typedef __int32_t int32_t; | ^~~~~~~ /tmp/git/soci/src/backends/postgresql/blob.cpp:77:60: error: 'int32_t' is not a member of 'std'; did you mean 'int32_t'? 77 | const std::size_t batchSize = std::numeric_limits::max(); | ^~~~~~~ /usr/include/bits/stdint-intn.h:26:19: note: 'int32_t' declared here 26 | typedef __int32_t int32_t; | ^~~~~~~ /tmp/git/soci/src/backends/postgresql/blob.cpp:77:67: error: template argument 1 is invalid 77 | const std::size_t batchSize = std::numeric_limits::max(); | ^ /tmp/git/soci/src/backends/postgresql/blob.cpp: In member function 'virtual std::size_t soci::postgresql_blob_backend::write_from_start(const void*, std::size_t, std::size_t)': /tmp/git/soci/src/backends/postgresql/blob.cpp:115:60: error: 'int32_t' is not a member of 'std'; did you mean 'int32_t'? 115 | const std::size_t batchSize = std::numeric_limits::max(); | ^~~~~~~ /usr/include/bits/stdint-intn.h:26:19: note: 'int32_t' declared here 26 | typedef __int32_t int32_t; | ^~~~~~~ /tmp/git/soci/src/backends/postgresql/blob.cpp:115:60: error: 'int32_t' is not a member of 'std'; did you mean 'int32_t'? 115 | const std::size_t batchSize = std::numeric_limits::max(); | ^~~~~~~ /usr/include/bits/stdint-intn.h:26:19: note: 'int32_t' declared here 26 | typedef __int32_t int32_t; | ^~~~~~~ /tmp/git/soci/src/backends/postgresql/blob.cpp:115:67: error: template argument 1 is invalid 115 | const std::size_t batchSize = std::numeric_limits::max(); | ^ ```
vadz commented 2 months ago

Thanks for fixing this!