Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix Issue 15958 - Missing extern(Windows) of core.sys.windows functions #1550

Merged
merged 2 commits into from Apr 26, 2016

Conversation

qchikara
Copy link
Contributor

added some extern (Windows).

Fix some core.sys.windows.* functions which have the extern (Windows)
linkages.
Fix core.sys.windows.ras functions which have extern (Windows) linkage.
To simplify, I unite a redundant repetition of specifier blocks.
@CyberShadow
Copy link
Member

LGTM

1 similar comment
@DmitryOlshansky
Copy link
Member

LGTM

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

@DmitryOlshansky DmitryOlshansky merged commit 7d84c69 into dlang:master Apr 26, 2016
@denis-sh
Copy link
Contributor

What is the reason to not add extern(Windows): at top of each module and instead search all the modules for function declarations?

@CyberShadow
Copy link
Member

I think one reason is that C macros translated as D functions shouldn't be extern(Windows).

@denis-sh
Copy link
Contributor

I think one reason is that C macros translated as D functions shouldn't be extern(Windows).

It's a minor case and extern(D) will help here. Also I don't see a strong reason even for extern(D) as there is nothing wrong in being extern(Windows) for D functions.

So looks like it's just an incorrect design.

@CyberShadow
Copy link
Member

Also I don't see a strong reason even for extern(D) as there is nothing wrong in being extern(Windows) for D functions.

It will pollute the global symbol namespace, perhaps even cause collisions. The calling convention is also less efficient. I'm not sure how it will affect inlining.

So looks like it's just an incorrect design.

You're welcome to have a go at it and see what breaks as a result.

@qchikara qchikara deleted the pr-winapi-linkage branch May 10, 2016 05:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants