Skip to content

Commit 8c3396a

Browse files
committed
Fix cross compiling on windows
1 parent b45cea5 commit 8c3396a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tccelf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,7 +2804,9 @@ static void create_arm_attribute_section(TCCState *s1)
28042804
#endif
28052805

28062806
#if TARGETOS_OpenBSD || TARGETOS_NetBSD || TARGETOS_FreeBSD
2807+
#ifndef _WIN32
28072808
#include <sys/utsname.h>
2809+
#endif
28082810

28092811
static void fill_bsd_note(Section *s, int type,
28102812
const char *value, uint32_t data)
@@ -2837,10 +2839,13 @@ static Section *create_bsd_note_section(TCCState *s1,
28372839
{
28382840
Section *s;
28392841
unsigned int major = 0, minor = 0, patch = 0;
2842+
#ifndef _WIN32
28402843
struct utsname uts;
28412844

2845+
/* Maybe move this to configure option for cross compiling */
28422846
if (!uname(&uts))
28432847
sscanf(uts.release, "%u.%u.%u", &major, &minor, &patch);
2848+
#endif
28442849
#if TARGETOS_FreeBSD
28452850
if (major < 14)
28462851
return NULL;

0 commit comments

Comments
 (0)