Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inline redefinition in Visual Studio when compiling C++ code #46

Merged
merged 3 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .azure-pipelines/azure-pipelines-osx.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .azure-pipelines/azure-pipelines-win.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ c_compiler:
- gcc
c_compiler_version:
- '7'
cdt_name:
- cos6
channel_sources:
- conda-forge,defaults
channel_targets:
Expand Down Expand Up @@ -37,5 +39,8 @@ readline:
- '8.0'
target_platform:
- linux-64
zip_keys:
- - c_compiler_version
- cxx_compiler_version
zlib:
- '1.2'
7 changes: 5 additions & 2 deletions .ci_support/linux_aarch64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BUILD:
c_compiler:
- gcc
c_compiler_version:
- '7.5'
- '7'
cdt_arch:
- aarch64
cdt_name:
Expand All @@ -15,7 +15,7 @@ channel_targets:
cxx_compiler:
- gxx
cxx_compiler_version:
- '7.5'
- '7'
docker_image:
- condaforge/linux-anvil-aarch64
gmp:
Expand Down Expand Up @@ -43,5 +43,8 @@ readline:
- '8.0'
target_platform:
- linux-aarch64
zip_keys:
- - c_compiler_version
- cxx_compiler_version
zlib:
- '1.2'
5 changes: 5 additions & 0 deletions .ci_support/linux_ppc64le_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ c_compiler:
- gcc
c_compiler_version:
- '8'
cdt_name:
- cos7
channel_sources:
- conda-forge,defaults
channel_targets:
Expand Down Expand Up @@ -37,5 +39,8 @@ readline:
- '8.0'
target_platform:
- linux-ppc64le
zip_keys:
- - c_compiler_version
- cxx_compiler_version
zlib:
- '1.2'
3 changes: 3 additions & 0 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ readline:
- '8.0'
target_platform:
- osx-64
zip_keys:
- - c_compiler_version
- cxx_compiler_version
zlib:
- '1.2'
4 changes: 0 additions & 4 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ channel_targets:
- conda-forge main
cxx_compiler:
- vs2017
libffi:
- '3.2'
openssl:
- 1.1.1
pin_run_as_build:
libffi:
max_pin: x.x
openssl:
max_pin: x.x.x
zlib:
Expand Down
26 changes: 19 additions & 7 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .scripts/run_docker_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions build-locally.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions recipe/fix-inline-redefinition-msvc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 49bb2e64ccca130f8e1a0b6ad36d442c1ad44ed7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
<[email protected]>
Date: Sat, 15 Feb 2020 18:30:53 +0900
Subject: [PATCH] avoid defining inline

Recent (since 2012 maybe?) MSVC ships a header named xkeycheck.h, which
(kindly!) aborts compilation on redefinition of C++ keywords. Let's not
define this in case of C++.
---
win32/Makefile.sub | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index ea5789fd3e9d..bd350dcd3175 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -860,8 +860,8 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
#define RUBY_SETJMP(env) _setjmp(env)
#define RUBY_LONGJMP(env,val) longjmp(env,val)
#define RUBY_JMP_BUF jmp_buf
-#define inline __inline
#ifndef __cplusplus
+#define inline __inline
!if $(MSC_VER) >= 1800
#define restrict __restrict
!else

3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ source:
patches:
# Patches/work-arounds for passing make check
- disable-backtrace-with-lines.patch
- fix-inline-redefinition-msvc.patch # [win]

build:
number: 0
number: 1
track_features:
- rb{{ major_minor | replace(".", "") }}
run_exports:
Expand Down