Explorar el Código

Fixed a bug that prevented build in release

master
Ludovic 'Archivist' Lagouardette hace 5 años
padre
commit
67f7eb12be
Se han modificado 2 ficheros con 12 adiciones y 13 borrados
  1. +2
    -2
      Makefile
  2. +10
    -11
      src/izaro-storage.cpp

+ 2
- 2
Makefile Ver fichero

@ -19,12 +19,12 @@
#
CXX := -g++
CXX := -clang++
DEBUG := -g -O0 -DUNITTEST
RELEASE := -s -O3 -fno-rtti
CXXFLAGS := $(DEBUG) -Wno-unknown-warning-option -Wno-address-of-packed-member -pedantic-errors -Wall -Wextra -Werror -Wfatal-errors -std=c++17 -m64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
CXXFLAGS := $(RELEASE) -Wno-unknown-warning-option -Wno-address-of-packed-member -pedantic-errors -Wall -Wextra -Werror -Wfatal-errors -std=c++17 -m64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
LDFLAGS := -L/usr/lib
BUILD := build
OBJ_DIR := $(BUILD)/objects

+ 10
- 11
src/izaro-storage.cpp Ver fichero

@ -52,34 +52,33 @@ int main(
}
size_t utest_size = 4096;
size_t db_port = 20450;
if(cmd_args.isFlagSet("-utest-count"))
if(cmd_args.isFlagSet("-port"))
{
try{
utest_size = std::stoll(cmd_args.getFlagValue("-utest-count"));
db_port = std::stoi(cmd_args.getFlagValue("-port"));
if(db_port>std::numeric_limits<uint16_t>::max()) throw std::runtime_error("invalid_port");
} catch (...) {
std::cerr << "Invalid utest-count value" << std::endl;
std::cerr << "Invalid port value" << std::endl;
return 1;
}
}
size_t db_port = 20450;
#ifdef UNITTEST
size_t utest_size = 4096;
if(cmd_args.isFlagSet("-port"))
if(cmd_args.isFlagSet("-utest-count"))
{
try{
db_port = std::stoi(cmd_args.getFlagValue("-port"));
if(db_port>std::numeric_limits<uint16_t>::max()) throw std::runtime_error("invalid_port");
utest_size = std::stoll(cmd_args.getFlagValue("-utest-count"));
} catch (...) {
std::cerr << "Invalid port value" << std::endl;
std::cerr << "Invalid utest-count value" << std::endl;
return 1;
}
}
#ifdef UNITTEST
{
database db(database::create(utest_str, utest_size*2));

Cargando…
Cancelar
Guardar