Skip to content

Commit

Permalink
update latest dependencies, my_basic and pdcurses
Browse files Browse the repository at this point in the history
  • Loading branch information
wwiv committed Dec 7, 2022
1 parent b418654 commit bef2b1f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
23 changes: 18 additions & 5 deletions bbs/basic/basic.cpp
Expand Up @@ -44,7 +44,7 @@ using namespace wwiv::strings;

namespace wwiv::bbs::basic {

int my_print(const char* fmt, ...) {
static int my_print(struct mb_interpreter_t *, const char* fmt, ...) {
char buf[1024];

va_list argptr;
Expand All @@ -57,7 +57,7 @@ int my_print(const char* fmt, ...) {
return MB_FUNC_OK;
}

int my_input(const char* prompt, char* buf, int size) {
static int my_input(struct mb_interpreter_t*, const char* prompt, char* buf, int size) {
if (prompt && *prompt) {
script_out().bputs(prompt);
}
Expand Down Expand Up @@ -103,7 +103,7 @@ static bool LoadBasicFile(mb_interpreter_t* bas, const std::string& script_name)
}
const auto ret = mb_load_string(bas, o.value().c_str(), true);
return ret == MB_FUNC_OK;
}
}

static void _on_error(struct mb_interpreter_t* s, mb_error_e e, const char* m, const char* f, int p,
unsigned short row, unsigned short col, int abort_code) {
Expand All @@ -112,7 +112,7 @@ static void _on_error(struct mb_interpreter_t* s, mb_error_e e, const char* m, c

if (e != SE_NO_ERR) {
if (f) {
if (e == SE_RN_WRONG_FUNCTION_REACHED) {
if (e == SE_RN_REACHED_TO_WRONG_FUNCTION) {
printf(
"Error:\n Line %d, Col %d in Func: %s\n Code %d, Abort Code %d\n Message: %s.\n",
row, col, f,
Expand Down Expand Up @@ -154,6 +154,19 @@ static int _on_stepped(struct mb_interpreter_t* s, void** l, const char* f, int
return MB_FUNC_OK;
}

static int _on_prev_stepped(struct mb_interpreter_t* s, void** l, const char* f, int p,
unsigned short row, unsigned short col) {
mb_unrefvar(s);
mb_unrefvar(l);
mb_unrefvar(f);
mb_unrefvar(p);
mb_unrefvar(row);
mb_unrefvar(col);

return MB_FUNC_OK;
}


Basic::Basic(common::Input& i, common::Output& o, const sdk::Config& config, common::Context* ctx)
: bin_(i), bout_(o), config_(config), ctx_(ctx) {

Expand All @@ -168,7 +181,7 @@ Basic::Basic(common::Input& i, common::Output& o, const sdk::Config& config, com
bas_ = SetupBasicInterpreter();
RegisterDefaultNamespaces();

mb_debug_set_stepped_handler(bas_, _on_stepped);
mb_debug_set_stepped_handler(bas_, _on_prev_stepped, _on_stepped);
}

static std::string ScriptBaseName(const std::string& script_name) {
Expand Down
10 changes: 5 additions & 5 deletions core/CMakeLists.txt
Expand Up @@ -56,7 +56,7 @@ if(WIN32)
endif()

if(OS2)
target_link_libraries(core libcx)
target_link_libraries(core PUBLIC libcx)
target_sources(core PRIVATE
"file_os2.cpp"
"os_os2.cpp"
Expand All @@ -70,16 +70,16 @@ endif()
configure_file(version_internal.h.in version_internal.h @ONLY)

#target_compile_options(core PRIVATE /fsanitize=address)
target_link_libraries(core fmt::fmt-header-only)
target_link_libraries(core cereal)
target_link_libraries(core PUBLIC fmt::fmt-header-only)
target_link_libraries(core PUBLIC cereal::cereal)
target_include_directories(core PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

if (UNIX)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# using regular Clang or AppleClang
target_link_libraries(core c++fs)
target_link_libraries(core PUBLIC c++fs)
else()
target_link_libraries(core stdc++fs)
target_link_libraries(core PUBLIC stdc++fs)
endif()
endif()

Expand Down
3 changes: 1 addition & 2 deletions network2/network2.cpp
Expand Up @@ -131,14 +131,13 @@ static bool handle_net_info_file(Context& context, const Network& net, NetPacket
}

static bool handle_sub_list(Context& context, NetPacket& p) {
const auto& net = context.net;
// Handle legacy type 9 main_type_sub_list (SUBS.LST)
NetInfoFileInfo info{};
info.filename = SUBS_LST;
info.data = p.text();
info.valid = true;
info.overwrite = true;
return write_net_received_file(context, net, p, info);
return write_net_received_file(context, context.net, p, info);
}

static bool handle_packet(Context& context, NetPacket& p) {
Expand Down
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 6625 files

0 comments on commit bef2b1f

Please sign in to comment.