瀏覽代碼

Fixed a bug that prevented build in release

master
Ludovic 'Archivist' Lagouardette 5 年之前
父節點
當前提交
67f7eb12be
共有 2 個檔案被更改,包括 12 行新增13 行删除
  1. +2
    -2
      Makefile
  2. +10
    -11
      src/izaro-storage.cpp

+ 2
- 2
Makefile 查看文件

@ -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 查看文件

@ -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));

Loading…
取消
儲存