Skip to content

Commit

Permalink
Various minor header fixups (#300)
Browse files Browse the repository at this point in the history
* src/files.c: stdio.h for printf
* src/memory.c: inttypes.h for PRIu64
* src/sdcard.c: string.h for strncpy
* src/testbench.c: string.h for strncpy
* src/utf8_encode.h: include guard
* src/video_win32.c: de facto standard case for windows.h
* src/wav_recorder.c: stdio.h for printf

I ran into all but one of the above compiling with Mingw-w64. The case
for windows.h is important for cross-compilation, and on case-sensitive
file systems it's always all lowercase. The missing include guard in
utf8_encode.h isn't normally a problem, but it affects my custom unity
build and its omission is likely an accident.
  • Loading branch information
skeeto authored Sep 26, 2024
1 parent 2985bfd commit 92495c6
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <SDL.h>
#include <zlib.h>
#include <inttypes.h>
Expand Down
1 change: 1 addition & 0 deletions src/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <inttypes.h>
#include "glue.h"
#include "via.h"
#include "memory.h"
Expand Down
1 change: 1 addition & 0 deletions src/sdcard.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <limits.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include "sdcard.h"
#include "files.h"

Expand Down
1 change: 1 addition & 0 deletions src/testbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "memory.h"
#include "cpu/fake6502.h"
#include "glue.h"
Expand Down
2 changes: 2 additions & 0 deletions src/utf8_encode.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma once

#include <stdint.h>

/**
Expand Down
2 changes: 1 addition & 1 deletion src/video_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <SDL.h>
#include <SDL_syswm.h>

#include <Windows.h>
#include <windows.h>
#include <dwmapi.h>

void video_win32_set_rounded_corners(SDL_Window *window)
Expand Down
1 change: 1 addition & 0 deletions src/wav_recorder.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "glue.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

#pragma pack(push, 1)
typedef struct {
Expand Down

0 comments on commit 92495c6

Please sign in to comment.