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

test: Check HAVE_GETOPT_H #354

Merged
merged 1 commit into from
Sep 1, 2020
Merged

test: Check HAVE_GETOPT_H #354

merged 1 commit into from
Sep 1, 2020

Conversation

jschueller
Copy link
Collaborator

No description provided.

@stevengj
Copy link
Owner

stevengj commented Aug 30, 2020

I'm worried about the case where the header file getopt.h is missing but we still have getopt in libc.

Probably we should also rename ourgetopt implementation to nlopt_getopt and add #define getopt nlopt_getopt etc. to nlopt-getopt.h

@jschueller
Copy link
Collaborator Author

or check that getopt function is available throught the compiler: check_function_exists(getopt HAVE_GETOPT)

@jschueller jschueller force-pushed the getopt branch 4 times, most recently from 11344d5 to 83a0d09 Compare August 31, 2020 07:33
@stevengj
Copy link
Owner

If the function is available through the compiler (i.e. linking succeeds), but getopt.h is not available, then I think we probably still want to use our own implementation — testopt.c will be using our own header file nlopt-getopt.h in any case, and we would be implicitly assuming that our header file matches the signature of the getopt implementation that the compiler is linking to.

@jschueller
Copy link
Collaborator Author

ok

@jschueller jschueller merged commit ff7e149 into stevengj:master Sep 1, 2020
@jschueller jschueller deleted the getopt branch September 1, 2020 06:00
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.

2 participants