Skip to content

Commit

Permalink
refactor PATH_SEP into a cmake define
Browse files Browse the repository at this point in the history
  • Loading branch information
dovholuknf committed Aug 23, 2024
1 parent 9a2b17e commit d5a2702
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ compile_commands.json
/docker/*.json
/docker/*.json.orig

.run
.run
CMakeFiles/
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ message("tunnel only = ${TUNNEL_SDK_ONLY}")
option(EXCLUDE_PROGRAMS "exclude building the programs directory" OFF)
message("exclude programs = ${EXCLUDE_PROGRAMS}")

if (WIN32)
add_compile_definitions(PATH_SEP="\\\\")
else()
add_compile_definitions(PATH_SEP="/")
endif()

find_package(Git)
if(NOT GIT_VERSION AND GIT_FOUND)
Expand Down
6 changes: 0 additions & 6 deletions programs/ziti-edge-tunnel/instance.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
#define MIN_API_PAGESIZE 10
#define DEFAULT_API_PAGESIZE 25

#if _WIN32
#define PATH_SEP '\\'
#else
#define PATH_SEP '/'
#endif

model_map tnl_identity_map = {0};
static const char* CFG_INTERCEPT_V1 = "intercept.v1";
static const char* CFG_HOST_V1 = "host.v1";
Expand Down
6 changes: 0 additions & 6 deletions programs/ziti-edge-tunnel/windows/log_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
#include "windows/windows-scripts.h"
#include <direct.h>

#if _WIN32
#define PATH_SEP "\\"
#else
#define PATH_SEP "/"
#endif


static bool open_log(char* log_filename);
static bool rotate_log();
Expand Down
2 changes: 0 additions & 2 deletions programs/ziti-edge-tunnel/ziti-edge-tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ static tunneler_context initialize_tunneler(netif_driver tun, uv_loop_t* ziti_lo
#if _WIN32
static void move_config_from_previous_windows_backup(uv_loop_t *loop);
#define LAST_CHAR_IPC_CMD '\n'
#define PATH_SEP "\\"
#else
#define LAST_CHAR_IPC_CMD '\0'
#define PATH_SEP "/"
#endif

struct ipc_cmd_s {
Expand Down

0 comments on commit d5a2702

Please sign in to comment.