Fix compilation on FreeBSD

Fixes #2073
Changes get_current_dir_name to functionally equivalent getcwd. Also moves "printf.h" to outside linux ifdef.
This commit is contained in:
l2ksolkov 2023-06-18 22:07:08 -07:00 committed by Rachael Alexanderson
parent c675d60bac
commit 01dfcc7d95

View file

@ -51,7 +51,6 @@
#include <asm/unistd.h> #include <asm/unistd.h>
#include <linux/perf_event.h> #include <linux/perf_event.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "printf.h"
#endif #endif
#include <SDL.h> #include <SDL.h>
@ -65,6 +64,7 @@
#include "c_cvars.h" #include "c_cvars.h"
#include "palutil.h" #include "palutil.h"
#include "st_start.h" #include "st_start.h"
#include "printf.h"
#ifndef NO_GTK #ifndef NO_GTK
@ -408,7 +408,7 @@ FString I_GetFromClipboard (bool use_primary_selection)
FString I_GetCWD() FString I_GetCWD()
{ {
char* curdir = get_current_dir_name(); char* curdir = getcwd(NULL,0);
if (!curdir) if (!curdir)
{ {
return ""; return "";
@ -447,7 +447,8 @@ unsigned int I_MakeRNGSeed()
void I_OpenShellFolder(const char* infolder) void I_OpenShellFolder(const char* infolder)
{ {
char* curdir = get_current_dir_name();
char* curdir = getcwd(NULL,0);
if (!chdir(infolder)) if (!chdir(infolder))
{ {