Skip to content

url: Load if_nametoindex() dynamically from iphlpapi.dll on Windows - #3958

Closed
captain-caveman2k wants to merge 1 commit into
curl:masterfrom
captain-caveman2k:IphlpApi.1
Closed

captain-caveman2k wants to merge 1 commit into
curl:masterfrom
captain-caveman2k:IphlpApi.1

Conversation

@captain-caveman2k

@captain-caveman2k captain-caveman2k commented May 28, 2019 •

Copy link
Copy Markdown
Contributor

This fixes the static dependency on iphlpapi.lib and allows curl to build for for targets prior to Windows Vista.

This partially reverts 170bd04.

Related to #3934 and #3943.

@captain-caveman2k
captain-caveman2k requested a review from bagder May 28, 2019 21:17
@captain-caveman2k captain-caveman2k added the Windows Windows-specific label May 28, 2019
Comment thread lib/system_win32.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a bit funny indented. I presume because it got so wide. In these case I would say
breaking the line after = is the saner approach so that the CURLX_ can start indented just two columns in on the following line.

Comment thread lib/system_win32.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/=/-/

@captain-caveman2k captain-caveman2k May 28, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously I can't type! I blame the new (Microsoft) keyboard !!

@captain-caveman2k captain-caveman2k changed the title url: Load if_nametoindex() dynamically on Windows url: Load if_nametoindex() from iphlpapi.dll dynamically on Windows May 28, 2019
@captain-caveman2k captain-caveman2k changed the title url: Load if_nametoindex() from iphlpapi.dll dynamically on Windows url: Load if_nametoindex() dynamically from iphlpapi.dll on Windows May 28, 2019
This fixes the static dependency on iphlpapi.lib and allows curl to
build for targets prior to Windows Vista.

This partially reverts 170bd04.
Comment thread lib/system_win32.c
s_hIpHlpApiDll = Curl_load_library(TEXT("iphlpapi.dll"));
if(s_hIpHlpApiDll) {
/* Get the address of the if_nametoindex function */
IF_NAMETOINDEX_FN pIfNameToIndex =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest assign directly to Curl_if_nametoindex. Other than that this looks fine to me. But don't ask me what's up with the segfaults in the --enable-ares build. I can't fathom how they could possibly be related. Please make sure to add Fixes/Closes/Bug:/Ref:/etc lines to the commit message before sending it upstream.

@captain-caveman2k
captain-caveman2k deleted the IphlpApi.1 branch May 31, 2019 11:43
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

URL Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

3 participants