"Fix" windows build
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 5s

TODO:
    Native Windows implementation.
This commit is contained in:
Stephen Seo 2024-07-26 13:23:51 +09:00
parent 40567d5a3a
commit bdbbf7dc16

View file

@ -893,10 +893,14 @@ int filenames_to_abs_map_fn(void *data, void *ud) {
__attribute__(( __attribute__((
cleanup(simple_archiver_internal_chdir_back2))) char *original_cwd = NULL; cleanup(simple_archiver_internal_chdir_back2))) char *original_cwd = NULL;
if (user_cwd) { if (user_cwd) {
#if SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN || \
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_MAC || \
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX
original_cwd = realpath(".", NULL); original_cwd = realpath(".", NULL);
if (chdir(user_cwd)) { if (chdir(user_cwd)) {
return 1; return 1;
} }
#endif
} }
// Get combined full path to file. // Get combined full path to file.
@ -1100,10 +1104,14 @@ int simple_archiver_write_all(FILE *out_f, SDArchiverState *state,
__attribute__(( __attribute__((
cleanup(simple_archiver_internal_chdir_back2))) char *original_cwd = NULL; cleanup(simple_archiver_internal_chdir_back2))) char *original_cwd = NULL;
if (state->parsed->user_cwd) { if (state->parsed->user_cwd) {
#if SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN || \
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_MAC || \
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX
original_cwd = realpath(".", NULL); original_cwd = realpath(".", NULL);
if (chdir(state->parsed->user_cwd)) { if (chdir(state->parsed->user_cwd)) {
return 1; return 1;
} }
#endif
} }
fprintf(stderr, "[%10u/%10u]\n", state->count, state->max); fprintf(stderr, "[%10u/%10u]\n", state->count, state->max);
if (simple_archiver_list_get(filenames, write_files_fn, state)) { if (simple_archiver_list_get(filenames, write_files_fn, state)) {