From e70d50cee4490a1a00cb0777917779f3097fd77f Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Wed, 3 Jan 2024 19:51:43 +0300 Subject: [PATCH] reverse-ramdisk.c: TempFile: reduce #if scope --- c-programming/reverse-ramdisk.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/c-programming/reverse-ramdisk.c b/c-programming/reverse-ramdisk.c index ad651d1..1300d45 100644 --- a/c-programming/reverse-ramdisk.c +++ b/c-programming/reverse-ramdisk.c @@ -39,19 +39,15 @@ To-Do: Add thread-safe versions of functions (use postfix `_r`) exit(EXIT_FAILURE); \ } while (0) +typedef struct { + int ID; + char* file_path; #if IS_POSIX -typedef struct { - int ID; - char* file_path; int file; -} TempFile; #else -typedef struct { - int ID; - char* file_path; FILE* file; -} TempFile; #endif +} TempFile; TempFile* temp_files = NULL; size_t num_temp_files = 0;