Unified · Split
| @@ -2804,7 +2804,9 @@ static void create_arm_attribute_section(TCCState *s1) · 2803 unmodified lines | |||
| 2804 | #endif | 2804 | #endif |
| 2805 | 2805 | ||
| 2806 | #if TARGETOS_OpenBSD || TARGETOS_NetBSD || TARGETOS_FreeBSD | 2806 | #if TARGETOS_OpenBSD || TARGETOS_NetBSD || TARGETOS_FreeBSD |
| 2807 | #ifndef _WIN32 | ||
| 2807 | #include <sys/utsname.h> | 2808 | #include <sys/utsname.h> |
| 2809 | #endif | ||
| 2808 | 2810 | ||
| 2809 | static void fill_bsd_note(Section *s, int type, | 2811 | static 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_FreeBSD | 2849 | #if TARGETOS_FreeBSD |
| 2845 | if (major < 14) | 2850 | if (major < 14) |
| 2846 | return NULL; | 2851 | return NULL; |