Rename platform constants

This commit is contained in:
2026-06-26 15:18:58 +01:00
parent ea689e7357
commit dc348f3e71
39 changed files with 241 additions and 241 deletions
+4 -4
View File
@@ -12,9 +12,9 @@
// TODO (Abdelrahman): This module needs rethinking
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
BEGIN_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
#define CMD_NO_EXIT(ERR) ((CMDResult){.exited = false, .exit_code = EXIT_FAILURE, .error = ERR})
@@ -22,8 +22,8 @@ CMDResult wapp_shell_commander_execute(CMDOutHandling out_handling, Str8 *out_bu
wapp_extern CMDError get_output_status(FILE *fp, i32 *status_out);
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
END_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
#endif // !COMMANDER_H
+4 -4
View File
@@ -7,9 +7,9 @@
#include "../../../common/platform/platform.h"
#include "../../../common/misc/misc_utils.h"
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
BEGIN_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
typedef enum {
SHELL_OUTPUT_DISCARD,
@@ -35,8 +35,8 @@ struct CMDResult {
wapp_misc_utils_reserve_padding(sizeof(b8) + sizeof(i32) + sizeof(CMDError));
};
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
END_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
#endif // !COMMANDER_OUTPUT_H
@@ -3,7 +3,7 @@
#include "../../../../common/aliases/aliases.h"
#include "../../../../common/platform/platform.h"
#ifdef WAPP_PLATFORM_POSIX
#ifdef WP_PLATFORM_POSIX
#include "../commander_output.h"
#include "../../utils/shell_utils.h"
@@ -22,4 +22,4 @@ CMDError get_output_status(FILE *fp, i32 *status_out) {
return SHELL_ERR_NO_ERROR;
}
#endif // !WAPP_PLATFORM_POSIX
#endif // !WP_PLATFORM_POSIX
+2 -2
View File
@@ -3,7 +3,7 @@
#include "../../../../common/aliases/aliases.h"
#include "../../../../common/platform/platform.h"
#ifdef WAPP_PLATFORM_WINDOWS
#ifdef WP_PLATFORM_WINDOWS
#include "../commander_output.h"
#include "../../utils/shell_utils.h"
@@ -21,4 +21,4 @@ CMDError get_output_status(FILE *fp, i32 *status_out) {
return SHELL_ERR_NO_ERROR;
}
#endif // !WAPP_PLATFORM_WINDOWS
#endif // !WP_PLATFORM_WINDOWS
@@ -4,7 +4,7 @@
#include "../../../../common/platform/platform.h"
#include "../../../../base/strings/str8/str8.h"
#ifdef WAPP_PLATFORM_POSIX
#ifdef WP_PLATFORM_POSIX
#include "../terminal_colours.h"
#include <stdio.h>
@@ -33,4 +33,4 @@ void print_coloured_text(Str8RO *text, TerminalColour colour) {
printf(WAPP_STR8_SPEC WAPP_STR8_SPEC, wapp_str8_varg(colours[colour]), wapp_str8_varg((*text)));
}
#endif // !WAPP_PLATFORM_POSIX
#endif // !WP_PLATFORM_POSIX
+4 -4
View File
@@ -8,9 +8,9 @@
#include "../../../common/platform/platform.h"
#include "../../../base/strings/str8/str8.h"
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
BEGIN_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
// TODO (Abdelrahman): Look into moving away from stdio in the implementation
@@ -19,8 +19,8 @@ void wapp_shell_termcolour_clear_colour(void);
wapp_extern void print_coloured_text(Str8RO *text, TerminalColour colour);
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
END_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
#endif // !TERM_COLOUR_H
+4 -4
View File
@@ -6,9 +6,9 @@
#include "../../../common/aliases/aliases.h"
#include "../../../common/platform/platform.h"
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
BEGIN_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
typedef enum {
WAPP_TERM_COLOUR_FG_BLACK,
@@ -32,8 +32,8 @@ typedef enum {
COUNT_TERM_COLOUR,
} TerminalColour;
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
END_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
#endif // !TERMINAL_COLOURS_H
+2 -2
View File
@@ -4,7 +4,7 @@
#include "../../../../common/platform/platform.h"
#include "../../../../base/strings/str8/str8.h"
#ifdef WAPP_PLATFORM_WINDOWS
#ifdef WP_PLATFORM_WINDOWS
#include "../terminal_colours.h"
#include "../../../../common/misc/misc_utils.h"
@@ -70,4 +70,4 @@ wapp_intern void init_data(TermcolourData *data) {
data->current_colour = data->default_colour;
}
#endif // !WAPP_PLATFORM_WINDOWS
#endif // !WP_PLATFORM_WINDOWS
+6 -6
View File
@@ -7,20 +7,20 @@
#include "../../../common/platform/platform.h"
#include <stdio.h>
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
BEGIN_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
#ifdef WAPP_PLATFORM_WINDOWS
#ifdef WP_PLATFORM_WINDOWS
#define wapp_shell_utils_popen _popen
#define wapp_shell_utils_pclose _pclose
#else
#define wapp_shell_utils_popen popen
#define wapp_shell_utils_pclose pclose
#endif /* ifdef WAPP_PLATFORM_WINDOWS */
#endif /* ifdef WP_PLATFORM_WINDOWS */
#ifdef WAPP_PLATFORM_CPP
#ifdef WP_PLATFORM_CPP
END_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
#endif // !WP_PLATFORM_CPP
#endif // !SHELL_UTILS_H