Compare commits
No commits in common. "9403193f09be42515a632ac9510e473f490c6610" and "b9ea290322616ccacb22171ed4e3eb796eb3e4fe" have entirely different histories.
9403193f09
...
b9ea290322
@ -59,4 +59,4 @@ If ($Status -ne 0) {
|
||||
}
|
||||
|
||||
# Build library
|
||||
Invoke-Expression "$Compiler $GeneralFlags $LibraryFlags $SrcFiles $Objects $Outputs"
|
||||
Invoke-Expression "$Compiler $GeneralFlags $LibraryFlags $IncludeDirs $SrcFiles $Objects $Outputs"
|
||||
|
8
compile
8
compile
@ -44,6 +44,8 @@ if [[ $CC == "gcc" ]]; then
|
||||
export ASAN_OPTIONS=verify_asan_link_order=0
|
||||
fi
|
||||
|
||||
INCLUDE="$(find src -type d | xargs -I{} echo -n "-I{} ")"
|
||||
|
||||
case $COMPONENTS in
|
||||
all)
|
||||
SRC="src/wapp.c"
|
||||
@ -61,7 +63,7 @@ case $COMPONENTS in
|
||||
;;
|
||||
esac
|
||||
|
||||
TEST_INCLUDE="$(find src -type d | xargs -I{} echo -n "-I{} ") $(find tests -type d | xargs -I{} echo -n "-I{} ")"
|
||||
TEST_INCLUDE="$(find tests -type d | xargs -I{} echo -n "-I{} ")"
|
||||
TEST_SRC="$(find tests -type f -name "*.c" | xargs -I{} echo -n "{} ")"
|
||||
|
||||
BUILD_DIR="libwapp-build/$PLATFORM-$BUILD_TYPE"
|
||||
@ -81,7 +83,7 @@ TEST_OUT="$BUILD_DIR/wapptest"
|
||||
|
||||
# Compile tests
|
||||
if [[ $(echo $TEST_SRC | xargs) != "" ]]; then
|
||||
(set -x ; $CC $CFLAGS $TEST_INCLUDE $SRC $TEST_SRC -o $TEST_OUT)
|
||||
(set -x ; $CC $CFLAGS $INCLUDE $TEST_INCLUDE $SRC $TEST_SRC -o $TEST_OUT)
|
||||
fi
|
||||
|
||||
# Run tests and exit on failure
|
||||
@ -97,4 +99,4 @@ if [[ -f $TEST_OUT ]]; then
|
||||
fi
|
||||
|
||||
# Compile library
|
||||
(set -x ; $CC $CFLAGS $LIBFLAGS $SRC -o $OUT)
|
||||
(set -x ; $CC $CFLAGS $LIBFLAGS $INCLUDE $SRC -o $OUT)
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MISC_UTILS_H
|
||||
#define MISC_UTILS_H
|
||||
|
||||
#include "../aliases/aliases.h"
|
||||
#include "aliases.h"
|
||||
|
||||
#define KB(SIZE) (SIZE * 1024ull)
|
||||
#define MB(SIZE) (KB(SIZE) * 1024)
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef WAPP_COMMON_H
|
||||
#define WAPP_COMMON_H
|
||||
|
||||
#include "aliases/aliases.h"
|
||||
#include "misc/misc_utils.h"
|
||||
#include "platform/platform.h"
|
||||
#include "aliases.h"
|
||||
#include "misc_utils.h"
|
||||
#include "platform.h"
|
||||
|
||||
#endif // !WAPP_COMMON_H
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "mem_allocator.h"
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
void *wapp_mem_allocator_alloc(const Allocator *allocator, u64 size) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MEM_ALLOCATOR_H
|
||||
#define MEM_ALLOCATOR_H
|
||||
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "aliases.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "mem_arena.h"
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../../common/misc/misc_utils.h"
|
||||
#include "../../os/mem/mem_os.h"
|
||||
#include "aliases.h"
|
||||
#include "misc_utils.h"
|
||||
#include "mem_os.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef MEM_ARENA_H
|
||||
#define MEM_ARENA_H
|
||||
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../os/mem/mem_os.h"
|
||||
#include "aliases.h"
|
||||
#include "mem_os.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,7 +1,5 @@
|
||||
#include "mem_arena_allocator.h"
|
||||
#include "mem_arena.h"
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../os/mem/mem_os.h"
|
||||
|
||||
internal inline void *mem_arena_alloc(u64 size, void *alloc_obj);
|
||||
internal inline void *mem_arena_alloc_aligned(u64 size, u64 alignment, void *alloc_obj);
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef MEM_ARENA_ALLOCATOR_H
|
||||
#define MEM_ARENA_ALLOCATOR_H
|
||||
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../allocator/mem_allocator.h"
|
||||
#include "../../os/mem/mem_os.h"
|
||||
#include "aliases.h"
|
||||
#include "mem_os.h"
|
||||
#include "mem_allocator.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "aliases.h"
|
||||
#include "mem_utils.h"
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <assert.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MEM_UTILS_H
|
||||
#define MEM_UTILS_H
|
||||
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "aliases.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
BEGIN_C_LINKAGE
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "cpath.h"
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../../common/misc/misc_utils.h"
|
||||
#include "../../mem/allocator/mem_allocator.h"
|
||||
#include "../../mem/arena/mem_arena_allocator.h"
|
||||
#include "../../strings/str8/str8.h"
|
||||
#include "aliases.h"
|
||||
#include "mem_allocator.h"
|
||||
#include "mem_arena_allocator.h"
|
||||
#include "misc_utils.h"
|
||||
#include "str8.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef CPATH_H
|
||||
#define CPATH_H
|
||||
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../../common/platform/platform.h"
|
||||
#include "../../mem/allocator/mem_allocator.h"
|
||||
#include "../../strings/str8/str8.h"
|
||||
#include "aliases.h"
|
||||
#include "mem_allocator.h"
|
||||
#include "platform.h"
|
||||
#include "str8.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
BEGIN_C_LINKAGE
|
||||
|
@ -1,15 +1,15 @@
|
||||
#include "mem_os.h"
|
||||
#include "mem_os_ops.h"
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../../common/platform/platform.h"
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(WAPP_PLATFORM_WINDOWS)
|
||||
#include "win/mem_os_win.h"
|
||||
#include "mem_os_win.h"
|
||||
#elif defined(WAPP_PLATFORM_POSIX)
|
||||
#include "posix/mem_os_posix.h"
|
||||
#include "mem_os_posix.h"
|
||||
#else
|
||||
#error "Unrecognised platform"
|
||||
#endif
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef MEM_OS_H
|
||||
#define MEM_OS_H
|
||||
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../../common/platform/platform.h"
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
BEGIN_C_LINKAGE
|
||||
@ -11,9 +11,9 @@ BEGIN_C_LINKAGE
|
||||
#include "mem_os_ops.h"
|
||||
|
||||
#if defined(WAPP_PLATFORM_WINDOWS)
|
||||
#include "win/mem_os_win.h"
|
||||
#include "mem_os_win.h"
|
||||
#elif defined(WAPP_PLATFORM_POSIX)
|
||||
#include "posix/mem_os_posix.h"
|
||||
#include "mem_os_posix.h"
|
||||
#else
|
||||
#error "Unrecognised platform"
|
||||
#endif
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "../../../../common/aliases/aliases.h"
|
||||
#include "../../../../common/platform/platform.h"
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef WAPP_PLATFORM_POSIX
|
||||
|
||||
#include "mem_os_ops.h"
|
||||
#include "mem_os_posix.h"
|
||||
#include "../mem_os_ops.h"
|
||||
#include <sys/mman.h>
|
||||
|
||||
internal const i32 access_types[] = {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MEM_OS_POSIX_H
|
||||
#define MEM_OS_POSIX_H
|
||||
|
||||
#include "../../../../common/platform/platform.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
BEGIN_C_LINKAGE
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "../../../../common/aliases/aliases.h"
|
||||
#include "../../../../common/platform/platform.h"
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef WAPP_PLATFORM_WINDOWS
|
||||
|
||||
#include "mem_os_ops.h"
|
||||
#include "mem_os_win.h"
|
||||
#include "../mem_os_ops.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MEM_OS_WIN_H
|
||||
#define MEM_OS_WIN_H
|
||||
|
||||
#include "../../../../common/platform/platform.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
BEGIN_C_LINKAGE
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include "commander.h"
|
||||
#include "aliases.h"
|
||||
#include "commander_output.h"
|
||||
#include "../utils/shell_utils.h"
|
||||
#include "../../../mem/allocator/mem_allocator.h"
|
||||
#include "../../../mem/arena/mem_arena_allocator.h"
|
||||
#include "../../../strings/str8/str8.h"
|
||||
#include "../../../../common/aliases/aliases.h"
|
||||
#include "../../../../common/misc/misc_utils.h"
|
||||
#include "mem_allocator.h"
|
||||
#include "mem_arena_allocator.h"
|
||||
#include "misc_utils.h"
|
||||
#include "shell_utils.h"
|
||||
#include "str8.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef COMMANDER_H
|
||||
#define COMMANDER_H
|
||||
|
||||
#include "aliases.h"
|
||||
#include "commander_output.h"
|
||||
#include "../../../../common/aliases/aliases.h"
|
||||
#include "../../../strings/str8/str8.h"
|
||||
#include "str8.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef COMMANDER_OUTPUT_H
|
||||
#define COMMANDER_OUTPUT_H
|
||||
|
||||
#include "../../../../common/aliases/aliases.h"
|
||||
#include "../../../../common/platform/platform.h"
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "../../../../../common/aliases/aliases.h"
|
||||
#include "../../../../../common/platform/platform.h"
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef WAPP_PLATFORM_POSIX
|
||||
|
||||
#include "../commander_output.h"
|
||||
#include "../../utils/shell_utils.h"
|
||||
#include "commander_output.h"
|
||||
#include "shell_utils.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "../../../../../common/aliases/aliases.h"
|
||||
#include "../../../../../common/platform/platform.h"
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef WAPP_PLATFORM_WINDOWS
|
||||
|
||||
#include "../commander_output.h"
|
||||
#include "../../utils/shell_utils.h"
|
||||
#include "commander_output.h"
|
||||
#include "shell_utils.h"
|
||||
#include <stdio.h>
|
||||
|
||||
CMDError get_output_status(FILE *fp, i32 *status_out) {
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "../../../../../common/aliases/aliases.h"
|
||||
#include "../../../../../common/platform/platform.h"
|
||||
#include "../../../../strings/str8/str8.h"
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
#include "str8.h"
|
||||
|
||||
#ifdef WAPP_PLATFORM_POSIX
|
||||
|
||||
#include "../terminal_colours.h"
|
||||
#include "terminal_colours.h"
|
||||
#include <stdio.h>
|
||||
|
||||
internal Str8RO colours[COUNT_TERM_COLOUR] = {
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "termcolour.h"
|
||||
#include "terminal_colours.h"
|
||||
#include "../../../strings/str8/str8.h"
|
||||
|
||||
void wapp_shell_termcolour_print_text(Str8RO *text, TerminalColour colour) {
|
||||
if (colour < WAPP_TERM_COLOUR_FG_BLACK || colour > WAPP_TERM_COLOUR_FG_BR_WHITE) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef TERM_COLOUR_H
|
||||
#define TERM_COLOUR_H
|
||||
|
||||
#include "aliases.h"
|
||||
#include "terminal_colours.h"
|
||||
#include "../../../../common/aliases/aliases.h"
|
||||
#include "../../../strings/str8/str8.h"
|
||||
#include "str8.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
BEGIN_C_LINKAGE
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include "../../../../../common/aliases/aliases.h"
|
||||
#include "../../../../../common/platform/platform.h"
|
||||
#include "../../../../strings/str8/str8.h"
|
||||
#include "aliases.h"
|
||||
#include "platform.h"
|
||||
#include "str8.h"
|
||||
|
||||
#ifdef WAPP_PLATFORM_WINDOWS
|
||||
|
||||
#include "../terminal_colours.h"
|
||||
#include "../../../../../common/misc/misc_utils.h"
|
||||
#include "misc_utils.h"
|
||||
#include "terminal_colours.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef SHELL_UTILS_H
|
||||
#define SHELL_UTILS_H
|
||||
|
||||
#include "../../../../common/platform/platform.h"
|
||||
#include "platform.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef WAPP_PLATFORM_WINDOWS
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "str8.h"
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../mem/allocator/mem_allocator.h"
|
||||
#include "aliases.h"
|
||||
#include "mem_allocator.h"
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef STR8_H
|
||||
#define STR8_H
|
||||
|
||||
#include "../../../common/aliases/aliases.h"
|
||||
#include "../../mem/allocator/mem_allocator.h"
|
||||
#include "aliases.h"
|
||||
#include "mem_allocator.h"
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
@ -2,20 +2,20 @@
|
||||
#define WAPP_CORE_C
|
||||
|
||||
#include "wapp_core.h"
|
||||
#include "strings/str8/str8.c"
|
||||
#include "os/shell/termcolour/posix/termcolour_posix.c"
|
||||
#include "os/shell/termcolour/win/termcolour_win.c"
|
||||
#include "os/shell/termcolour/termcolour.c"
|
||||
#include "os/shell/commander/posix/commander_posix.c"
|
||||
#include "os/shell/commander/win/commander_win.c"
|
||||
#include "os/shell/commander/commander.c"
|
||||
#include "os/cpath/cpath.c"
|
||||
#include "os/mem/posix/mem_os_posix.c"
|
||||
#include "os/mem/win/mem_os_win.c"
|
||||
#include "os/mem/mem_os.c"
|
||||
#include "mem/utils/mem_utils.c"
|
||||
#include "mem/allocator/mem_allocator.c"
|
||||
#include "mem/arena/mem_arena.c"
|
||||
#include "mem/arena/mem_arena_allocator.c"
|
||||
#include "mem_utils.c"
|
||||
#include "mem_arena.c"
|
||||
#include "mem_arena_allocator.c"
|
||||
#include "mem_allocator.c"
|
||||
#include "str8.c"
|
||||
#include "termcolour_win.c"
|
||||
#include "termcolour_posix.c"
|
||||
#include "termcolour.c"
|
||||
#include "commander_win.c"
|
||||
#include "commander.c"
|
||||
#include "commander_posix.c"
|
||||
#include "mem_os_win.c"
|
||||
#include "mem_os.c"
|
||||
#include "mem_os_posix.c"
|
||||
#include "cpath.c"
|
||||
|
||||
#endif // !WAPP_CORE_C
|
||||
|
@ -1,21 +1,21 @@
|
||||
#ifndef WAPP_CORE_H
|
||||
#define WAPP_CORE_H
|
||||
|
||||
#include "strings/str8/str8.h"
|
||||
#include "os/shell/termcolour/termcolour.h"
|
||||
#include "os/shell/termcolour/terminal_colours.h"
|
||||
#include "os/shell/commander/commander.h"
|
||||
#include "os/shell/commander/commander_output.h"
|
||||
#include "os/shell/utils/shell_utils.h"
|
||||
#include "os/cpath/cpath.h"
|
||||
#include "os/mem/posix/mem_os_posix.h"
|
||||
#include "os/mem/win/mem_os_win.h"
|
||||
#include "os/mem/mem_os_ops.h"
|
||||
#include "os/mem/mem_os.h"
|
||||
#include "mem/utils/mem_utils.h"
|
||||
#include "mem/allocator/mem_allocator.h"
|
||||
#include "mem/arena/mem_arena_allocator.h"
|
||||
#include "mem/arena/mem_arena.h"
|
||||
#include "../common/wapp_common.h"
|
||||
#include "mem_arena_allocator.h"
|
||||
#include "mem_arena.h"
|
||||
#include "mem_utils.h"
|
||||
#include "mem_allocator.h"
|
||||
#include "str8.h"
|
||||
#include "termcolour.h"
|
||||
#include "terminal_colours.h"
|
||||
#include "shell_utils.h"
|
||||
#include "commander_output.h"
|
||||
#include "commander.h"
|
||||
#include "mem_os_ops.h"
|
||||
#include "mem_os_win.h"
|
||||
#include "mem_os.h"
|
||||
#include "mem_os_posix.h"
|
||||
#include "cpath.h"
|
||||
#include "wapp_common.h"
|
||||
|
||||
#endif // !WAPP_CORE_H
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "tester.h"
|
||||
#include "../../common/aliases/aliases.h"
|
||||
#include "../../core/os/shell/termcolour/termcolour.h"
|
||||
#include "../../core/strings/str8/str8.h"
|
||||
#include "aliases.h"
|
||||
#include "termcolour.h"
|
||||
#include "str8.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef TESTER_H
|
||||
#define TESTER_H
|
||||
|
||||
#include "../../common/misc/misc_utils.h"
|
||||
#include "../../common/platform/platform.h"
|
||||
#include "../../core/strings/str8/str8.h"
|
||||
#include "misc_utils.h"
|
||||
#include "platform.h"
|
||||
#include "str8.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define WAPP_TESTING_C
|
||||
|
||||
#include "wapp_testing.h"
|
||||
#include "tester/tester.c"
|
||||
#include "../core/wapp_core.c"
|
||||
#include "tester.c"
|
||||
#include "wapp_core.c"
|
||||
|
||||
#endif // !WAPP_TESTING_C
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef WAPP_TESTING_H
|
||||
#define WAPP_TESTING_H
|
||||
|
||||
#include "tester/tester.h"
|
||||
#include "../common/wapp_common.h"
|
||||
#include "../core/wapp_core.h"
|
||||
#include "tester.h"
|
||||
#include "wapp_common.h"
|
||||
#include "wapp_core.h"
|
||||
|
||||
#endif // !WAPP_TESTING_H
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define WAPP_C
|
||||
|
||||
#include "wapp.h"
|
||||
#include "core/wapp_core.c"
|
||||
#include "testing/wapp_testing.c"
|
||||
#include "wapp_core.c"
|
||||
#include "wapp_testing.c"
|
||||
|
||||
#endif // !WAPP_C
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef WAPP_H
|
||||
#define WAPP_H
|
||||
|
||||
#include "common/wapp_common.h"
|
||||
#include "core/wapp_core.h"
|
||||
#include "testing/wapp_testing.h"
|
||||
#include "wapp_common.h"
|
||||
#include "wapp_core.h"
|
||||
#include "wapp_testing.h"
|
||||
|
||||
#endif // !WAPP_H
|
||||
|
Loading…
Reference in New Issue
Block a user