Make win-specific functions static

This commit is contained in:
bumbread 2022-08-08 23:46:50 +11:00
parent b426c0f2ee
commit f943f8167c
6 changed files with 12 additions and 12 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -7,9 +7,9 @@
#include <DbgHelp.h>
#include <winternl.h>
void _setup_timer(void);
void _setup_eh();
void _setup_heap();
void _setup_io();
void _close_io();
void __security_init_cookie();
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();