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

various windows fixes #586

Merged
merged 2 commits into from
Dec 7, 2018
Merged

various windows fixes #586

merged 2 commits into from
Dec 7, 2018

Conversation

fdopen
Copy link
Contributor

@fdopen fdopen commented Dec 6, 2018

This will remove __USE_MINGW_ANSI_STDIO from the stub generation code. __USE_MINGW_ANSI_STDIO must be defined before any other relevant headers are included. This is often not guaranteed because custom headers are added before calls to Cstubs.write_c. I've instead added the ctypes_printf macro for usage inside generated code, which translates to __mingw_printf for mingw, and printf otherwise. (Background: On windows one can link again various version of the c stdlib (crt). They are all not really compatible to C99. Instead of adding and testing workarounds for each version, the compatibility layer of mingw is used. This layer is normally enabled by defining __USE_MINGW_ANSI_STDIO or by certain compiler switches.)

The second commit removes a dll dependency introduced by OCaml 4.07 and adds further workarounds to the test suite.

`__USE_MINGW_ANSI_STDIO` must be defined before any other relevant
headers are included. This is often not guaranteed because custom
headers are added before calls to `Cstubs.write_c`. A
macro ('ctypes_printf') is introduced instead.

Background: On windows one can link again various version of the
cstlib (crt). They are all not really compatible to C99. Instead of
testing workarounds for each version, the compatibility layer of mingw
is used.
workarounds for
 - ocaml/ocaml#1535 (no dll dependency)
 - ocaml/ocaml#1528 (string_of_float format)
 - ocaml/ocaml#1479 (chdir changes environment)
@yallop
Copy link
Owner

yallop commented Dec 6, 2018

Thank you!

@yallop yallop merged commit e192f74 into yallop:master Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants