1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-10-02 06:20:05 +00:00

Protected handler calls in bot.c

- Added support for LAIKAPKT_HANDSHAKE_RES
This commit is contained in:
2022-01-25 11:58:36 -06:00
parent 1bccc78117
commit 04f02b4371
8 changed files with 40 additions and 21 deletions

View File

@@ -6,10 +6,10 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(LIB_INCLUDEDIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
# version details
set(LIB_VERSION_MAJOR 0)
set(LIB_VERSION_MINOR 0)
set(LAIKA_VERSION_MAJOR 0)
set(LAIKA_VERSION_MINOR 0)
project(LaikaLib VERSION ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR})
project(LaikaLib VERSION ${LAIKA_VERSION_MAJOR}.${LAIKA_VERSION_MINOR})
# Put CMake targets (ALL_BUILD/ZERO_CHECK) into a folder
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@@ -19,10 +19,10 @@ file(GLOB_RECURSE LIBSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c)
add_library(LaikaLib STATIC ${LIBSOURCE})
# add the version definitions and the 'DEBUG' preprocessor definition if we're compiling as Debug
target_compile_definitions(LaikaLib PUBLIC LIB_VERSION_MAJOR=${LIB_VERSION_MAJOR} LIB_VERSION_MINOR=${LIB_VERSION_MINOR} "$<$<CONFIG:Debug>:DEBUG>")
target_compile_definitions(LaikaLib PUBLIC LAIKA_VERSION_MAJOR=${LAIKA_VERSION_MAJOR} LAIKA_VERSION_MINOR=${LAIKA_VERSION_MINOR} "$<$<CONFIG:Debug>:DEBUG>")
# add include directory
target_include_directories(LaikaLib PUBLIC ${LIB_INCLUDEDIR})
# set library name
set_target_properties(LaikaLib PROPERTIES OUTPUT_NAME laika-${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR})
set_target_properties(LaikaLib PROPERTIES OUTPUT_NAME laika-${LAIKA_VERSION_MAJOR}.${LAIKA_VERSION_MINOR})

View File

@@ -10,13 +10,19 @@
#define ARRAY_START 4
/* for intellisense */
#ifndef LIB_VERSION_MAJOR
#define LIB_VERSION_MAJOR 0
#ifdef DEBUG
#define LAIKA_DEBUG(...) printf(__VA_ARGS__);
#else
#define LAIKA_DEBUG(...)
#endif
#ifndef LIB_VERSION_MINOR
#define LIB_VERSION_MINOR 0
/* for intellisense */
#ifndef LAIKA_VERSION_MAJOR
#define LAIKA_VERSION_MAJOR 0
#endif
#ifndef LAIKA_VERSION_MINOR
#define LAIKA_VERSION_MINOR 0
#endif
#endif