History

Fix cross compiling on windows

herman ten brugge committed 1 year ago

Commit 8c3396a1 parent b45cea51 file · +5 −0Browse files

Unified · Split

tccelf.c+5−0
@@ -2804,7 +2804,9 @@ static void create_arm_attribute_section(TCCState *s1) · 2803 unmodified lines
2804#endif2804#endif
2805 2805
2806#if TARGETOS_OpenBSD || TARGETOS_NetBSD || TARGETOS_FreeBSD2806#if TARGETOS_OpenBSD || TARGETOS_NetBSD || TARGETOS_FreeBSD
2807#ifndef _WIN32
2807#include <sys/utsname.h>2808#include <sys/utsname.h>
2809#endif
2808 2810
2809static void fill_bsd_note(Section *s, int type,2811static void fill_bsd_note(Section *s, int type,
2810 const char *value, uint32_t data)2812 const char *value, uint32_t data)
@@ -2837,10 +2839,13 @@ static Section *create_bsd_note_section(TCCState *s1, · 26 unmodified lines
2837{2839{
2838 Section *s;2840 Section *s;
2839 unsigned int major = 0, minor = 0, patch = 0;2841 unsigned int major = 0, minor = 0, patch = 0;
2842#ifndef _WIN32
2840 struct utsname uts;2843 struct utsname uts;
2841 2844
2845/* Maybe move this to configure option for cross compiling */
2842 if (!uname(&uts))2846 if (!uname(&uts))
2843 sscanf(uts.release, "%u.%u.%u", &major, &minor, &patch);2847 sscanf(uts.release, "%u.%u.%u", &major, &minor, &patch);
2848#endif
2844#if TARGETOS_FreeBSD2849#if TARGETOS_FreeBSD
2845 if (major < 14)2850 if (major < 14)
2846 return NULL;2851 return NULL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t