From f943f8167cdc32ee03c16dc19b51c0289e83e7f3 Mon Sep 17 00:00:00 2001 From: bumbread Date: Mon, 8 Aug 2022 23:46:50 +1100 Subject: [PATCH] Make win-specific functions static --- src/_win/cookie.c | 2 +- src/_win/heap.c | 2 +- src/_win/signal.c | 2 +- src/_win/stdio.c | 4 ++-- src/_win/time.c | 2 +- src/_win/win.h | 12 ++++++------ 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/_win/cookie.c b/src/_win/cookie.c index 1f3b009..2833bf5 100644 --- a/src/_win/cookie.c +++ b/src/_win/cookie.c @@ -1,7 +1,7 @@ u64 __security_cookie; -void __security_init_cookie() { +static void __security_init_cookie() { // They say it's a random number so I generated // one using numbergenerator.org __security_cookie = 0xb26e04cc62ba48a; diff --git a/src/_win/heap.c b/src/_win/heap.c index 1f15451..b0f0366 100644 --- a/src/_win/heap.c +++ b/src/_win/heap.c @@ -9,7 +9,7 @@ static intptr_t align_forward(intptr_t p, size_t a) { return (p+a-1)&~(a-1); } -void _setup_heap() { +static void _setup_heap() { heap_handle = GetProcessHeap(); if (heap_handle == NULL) { ExitProcess(-42069); diff --git a/src/_win/signal.c b/src/_win/signal.c index 91f53d9..0298799 100644 --- a/src/_win/signal.c +++ b/src/_win/signal.c @@ -42,7 +42,7 @@ static LONG _win32_handler(EXCEPTION_POINTERS *ExceptionInfo) { } -void _setup_eh() { +static void _setup_eh() { void *res = AddVectoredExceptionHandler(1, &_win32_handler); if(res == NULL) { ExitProcess(-69420); diff --git a/src/_win/stdio.c b/src/_win/stdio.c index f170fb9..c2d2be7 100644 --- a/src/_win/stdio.c +++ b/src/_win/stdio.c @@ -109,7 +109,7 @@ static inline void delete_stream(FILE *stream) { mtx_destroy(&lock); } -void _setup_io() { +static void _setup_io() { HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE hstderr = GetStdHandle(STD_ERROR_HANDLE); HANDLE hstdin = GetStdHandle(STD_INPUT_HANDLE); @@ -254,7 +254,7 @@ int fclose(FILE *stream) { return 0; } -void _close_io() { +static void _close_io() { while(streams_to_close != NULL) { FILE *stream = streams_to_close; fflush(stream); diff --git a/src/_win/time.c b/src/_win/time.c index 6303159..022ec01 100644 --- a/src/_win/time.c +++ b/src/_win/time.c @@ -12,7 +12,7 @@ static uint64_t timer_freq; static uint64_t timer_start; -void _setup_timer(void) { +static void _setup_timer(void) { LARGE_INTEGER freq, start; QueryPerformanceFrequency(&freq); QueryPerformanceCounter(&start); diff --git a/src/_win/win.h b/src/_win/win.h index 9daefb1..1f24001 100644 --- a/src/_win/win.h +++ b/src/_win/win.h @@ -7,9 +7,9 @@ #include #include -void _setup_timer(void); -void _setup_eh(); -void _setup_heap(); -void _setup_io(); -void _close_io(); -void __security_init_cookie(); \ No newline at end of file +static void _setup_timer(void); +static void _setup_eh(); +static void _setup_heap(); +static void _setup_io(); +static void _close_io(); +static void __security_init_cookie(); \ No newline at end of file