Compare commits

...

2 Commits

3 changed files with 10 additions and 6 deletions

View File

@ -8,14 +8,18 @@ RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https:
# Update the system and install various dependencies
RUN apt-get update && \
apt-get install -y git cmake ninja-build build-essential tar curl zip unzip pkg-config autoconf python3 \
apt-get install -y git cmake ninja-build clang tar curl zip unzip pkg-config autoconf python3 \
libdevil-dev libncurses5-dev libbsd-dev
# Arm specific
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
# Set clang as default compiler
RUN update-alternatives --set cc /usr/bin/clang
RUN update-alternatives --set c++ /usr/bin/clang++
# Install vcpkg and the required libraries
RUN git clone https://github.com/Microsoft/vcpkg.git
RUN git clone --depth 1 https://github.com/Microsoft/vcpkg.git
RUN bash ./vcpkg/bootstrap-vcpkg.sh
RUN ./vcpkg/vcpkg install cryptopp effolkronium-random libmariadb libevent lzo fmt spdlog argon2
@ -23,13 +27,13 @@ COPY . .
# Build the binaries
RUN mkdir build/
RUN cd build && cmake -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake ..
RUN cd build && cmake -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug ..
RUN cd build && make -j $(nproc)
FROM ubuntu:22.04 AS app
WORKDIR /app
RUN apt-get update && apt-get install -y gettext python2 libdevil-dev libbsd-dev && apt-get clean
RUN apt-get update && apt-get install -y gettext python2 libdevil1c2 libbsd0 && apt-get clean
# Copy the binaries from the build stage
COPY --from=build /app/build/src/db/db /bin/db

View File

@ -32,7 +32,7 @@ class CStmt
std::vector<MYSQL_BIND> m_vec_param;
unsigned int m_uiParamCount;
uint64_t * m_puiParamLen;
unsigned long * m_puiParamLen;
std::vector<MYSQL_BIND> m_vec_result;
unsigned int m_uiResultCount;

View File

@ -59,7 +59,7 @@ bool CStmt::Prepare(CAsyncSQL * sql, const char * c_pszQuery)
m_vec_param.resize(iParamCount);
memset(&m_vec_param[0], 0, sizeof(MYSQL_BIND) * iParamCount);
m_puiParamLen = (uint64_t *) calloc(iParamCount, sizeof(uint64_t));
m_puiParamLen = (unsigned long *) calloc(iParamCount, sizeof(unsigned long));
}
m_vec_result.resize(48);