8000 Header only by rmpowell77 · Pull Request #37 · docopt/docopt.cpp · GitHub
[go: up one dir, main page]

Skip to content

Header only #37

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

Merged
merged 3 commits into from
May 15, 2016
Merged

Header only #37

merged 3 commits into from
May 15, 2016

Conversation

rmpowell77
Copy link
Contributor

Changes to make docopt.cpp header only.

A user would define the preprocessor macro DOCOPT_HEADER_ONLY to control this behavior. This cause the cpp file to be included with the header file.

I've moved most of the inline functions out of docopt.cpp to docopt_private.h as I was making them inline to remove them from the symbol table in Header only mode, so I thought it would be best to put them closer to the functions.

I've tested by building with clang on Mac, and I see a small change in the size of the lib (<1 kbyte smaller).

Allow a user to specify they want header only with the macro DOCOPT_HEADER_ONLY.  docopt.h will include docopt.cpp as inline functions.
Allow a user to specify they want header only with the macro DOCOPT_HEADER_ONLY.  docopt.h will include docopt.cpp as inline functions.
… that functions were showing up in the public symboltable. To remove that, I would mark them as inline, but then I figured I would put the functions closer to the class name.
@GamePad64
Copy link
Contributor

Well, this may require changes to CMakeLists.txt. After the maintainer merges this PR I will write a fix for CMake build.

@jaredgrubb
Copy link
Member

Travis seems ok, so I'll merge it.

@jaredgrubb jaredgrubb merged commit c15f292 into docopt:master May 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
47A0 None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0