Skip to content

Commit c5da9de

Browse files
authored
build: remove mingw32 support macro (#34471)
We have not supported this compiler in many years (though its successor project, mingw-w64, also defined it). And it's a weird combination of compiler and platform specifics: the present uses were generally either using it instead of either the more appropriate GCC or WINDOWS.
1 parent ed177d1 commit c5da9de

File tree

14 files changed

+22
-36
lines changed

14 files changed

+22
-36
lines changed

src/codegen.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ JL_DLLEXPORT void __stack_chk_fail()
117117

118118
#ifdef _OS_WINDOWS_
119119
#if defined(_CPU_X86_64_)
120-
#if defined(_COMPILER_MINGW_)
120+
#if defined(_COMPILER_GCC_)
121121
extern void ___chkstk_ms(void);
122122
#else
123123
extern void __chkstk(void);
124124
#endif
125125
#else
126-
#if defined(_COMPILER_MINGW_)
126+
#if defined(_COMPILER_GCC_)
127127
#undef _alloca
128128
extern void _alloca(void);
129129
#else
@@ -7503,7 +7503,7 @@ static void init_julia_llvm_env(Module *m)
75037503
#endif
75047504
#ifndef FORCE_ELF
75057505
#if defined(_CPU_X86_64_)
7506-
#if defined(_COMPILER_MINGW_)
7506+
#if defined(_COMPILER_GCC_)
75077507
Function *chkstk_func = Function::Create(FunctionType::get(T_void, false),
75087508
Function::ExternalLinkage, "___chkstk_ms", m);
75097509
add_named_global(chkstk_func, &___chkstk_ms, /*dllimport*/false);
@@ -7513,7 +7513,7 @@ static void init_julia_llvm_env(Module *m)
75137513
add_named_global(chkstk_func, &__chkstk, /*dllimport*/false);
75147514
#endif
75157515
#else
7516-
#if defined(_COMPILER_MINGW_)
7516+
#if defined(_COMPILER_GCC_)
75177517
Function *chkstk_func = Function::Create(FunctionType::get(T_void, false),
75187518
Function::ExternalLinkage, "_alloca", m);
75197519
add_named_global(chkstk_func, &_alloca, /*dllimport*/false);

src/flisp/flisp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
extern "C" {
5252
#endif
5353

54-
#if defined(_OS_WINDOWS_) && !defined(_COMPILER_MINGW_)
54+
#if defined(_OS_WINDOWS_) && !defined(_COMPILER_GCC_)
5555
#include <malloc.h>
5656
JL_DLLEXPORT char * dirname(char *);
5757
#else

src/flisp/flisp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ char *tostring(fl_context_t *fl_ctx, value_t v, const char *fname);
169169
/* error handling */
170170
#if defined(_OS_WINDOWS_)
171171
#define fl_jmp_buf jmp_buf
172-
#if defined(_COMPILER_MINGW_)
172+
#if defined(_COMPILER_GCC_)
173173
int __attribute__ ((__nothrow__,__returns_twice__)) (jl_setjmp)(jmp_buf _Buf);
174174
__declspec(noreturn) __attribute__ ((__nothrow__)) void (jl_longjmp)(jmp_buf _Buf, int _Value);
175175
#else

src/gc.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,7 @@ unsigned ffs_u32(uint32_t bitvec) JL_NOTSAFEPOINT;
367367
#else
368368
STATIC_INLINE unsigned ffs_u32(uint32_t bitvec)
369369
{
370-
#if defined(_COMPILER_MINGW_)
371-
return __builtin_ffs(bitvec) - 1;
372-
#elif defined(_COMPILER_MICROSOFT_)
370+
#if defined(_COMPILER_MICROSOFT_)
373371
unsigned long j;
374372
_BitScanForward(&j, bitvec);
375373
return j;

src/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <errno.h>
1515

16-
#if !defined(_OS_WINDOWS_) || defined(_COMPILER_MINGW_)
16+
#if !defined(_OS_WINDOWS_) || defined(_COMPILER_GCC_)
1717
#include <getopt.h>
1818
#endif
1919

src/jl_uv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,10 @@ extern int vasprintf(char **str, const char *fmt, va_list ap);
563563

564564
JL_DLLEXPORT int jl_vprintf(uv_stream_t *s, const char *format, va_list args)
565565
{
566-
char *str=NULL;
566+
char *str = NULL;
567567
int c;
568568
va_list al;
569-
#if defined(_OS_WINDOWS_) && !defined(_COMPILER_MINGW_)
569+
#if defined(_OS_WINDOWS_) && !defined(_COMPILER_GCC_)
570570
al = args;
571571
#else
572572
va_copy(al, args);

src/jlapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern "C" {
2222
#include <fenv.h>
2323
#endif
2424

25-
#if defined(_OS_WINDOWS_) && !defined(_COMPILER_MINGW_)
25+
#if defined(_OS_WINDOWS_) && !defined(_COMPILER_GCC_)
2626
JL_DLLEXPORT char * __cdecl dirname(char *);
2727
#else
2828
#include <libgen.h>

src/julia.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,7 @@ JL_DLLEXPORT size_t jl_excstack_state(void);
17831783
JL_DLLEXPORT void jl_restore_excstack(size_t state);
17841784

17851785
#if defined(_OS_WINDOWS_)
1786-
#if defined(_COMPILER_MINGW_)
1786+
#if defined(_COMPILER_GCC_)
17871787
int __attribute__ ((__nothrow__,__returns_twice__)) (jl_setjmp)(jmp_buf _Buf);
17881788
__declspec(noreturn) __attribute__ ((__nothrow__)) void (jl_longjmp)(jmp_buf _Buf, int _Value);
17891789
#else

src/julia_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "options.h"
77
#include "locks.h"
88
#include <uv.h>
9-
#if !defined(_MSC_VER) && !defined(__MINGW32__)
9+
#if !defined(_WIN32)
1010
#include <unistd.h>
1111
#else
1212
#define sleep(x) Sleep(1000*x)

src/rtutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ JL_DLLEXPORT jl_nullable_float32_t jl_try_substrtof(char *str, size_t offset, si
465465
bstr = newstr;
466466
pend = bstr+len;
467467
}
468-
#if defined(_OS_WINDOWS_) && !defined(_COMPILER_MINGW_)
468+
#if defined(_OS_WINDOWS_) && !defined(_COMPILER_GCC_)
469469
float out = (float)jl_strtod_c(bstr, &p);
470470
#else
471471
float out = jl_strtof_c(bstr, &p);

0 commit comments

Comments
 (0)