summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsayjones.plus.com>2019-11-28 17:45:06 +0000
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-12-04 02:52:25 +0100
commit4dbb32518e47b064b8df2fe0b3a4cd0add6b2406 (patch)
treec6ea3ee1f326af782c81827874e7c9a7bdf81469
parent68ac1bb244bba6c1531338329531a9d5ef22180b (diff)
downloadsparse-4dbb32518e47b064b8df2fe0b3a4cd0add6b2406.tar.gz
cgcc: only define __CYGWIN32__ for -m32 builds
'__CYGWIN32__' is wrongly defined on 64-bit Cygwin. Fix this by only defining it when $m32 is set and set $m32 when i386 is selected. Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rwxr-xr-xcgcc4
1 files changed, 3 insertions, 1 deletions
diff --git a/cgcc b/cgcc
index e6541d36..f5a8b352 100755
--- a/cgcc
+++ b/cgcc
@@ -254,7 +254,8 @@ sub add_specs {
} elsif ( $spec =~ /^cygwin/) {
return &add_specs ('unix') .
' -fshort-wchar' .
- ' -D__CYGWIN__=1 -D__CYGWIN32__=1' .
+ ' -D__CYGWIN__=1' .
+ ($m32 ? ' -D__CYGWIN32__=1' : '') .
" -D'_cdecl=__attribute__((__cdecl__))'" .
" -D'__cdecl=__attribute__((__cdecl__))'" .
" -D'_stdcall=__attribute__((__stdcall__))'" .
@@ -263,6 +264,7 @@ sub add_specs {
" -D'__fastcall=__attribute__((__fastcall__))'" .
" -D'__declspec(x)=__attribute__((x))'";
} elsif ($spec eq 'i386') {
+ $m32 = 1;
return (
' --arch=i386' .
&float_types (1, 1, 21, [24,8], [53,11], [64,15]));