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

Add missing optparse_long_only() and useful macros for Windows, also separate definition and implementation. #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eeeeeeeelias
Copy link

No description provided.

@eeeeeeeelias eeeeeeeelias changed the title Add missing optparse_long_only() and useful macros. Add missing optparse_long_only() and useful macros for Windows. Jun 10, 2019
@eeeeeeeelias eeeeeeeelias changed the title Add missing optparse_long_only() and useful macros for Windows. Add missing optparse_long_only() and useful macros for Windows, also separate definition and implementation. Jun 14, 2019
@@ -44,20 +44,28 @@
* arguments to the end. This can be disabled by setting the `permute`
* field to 0 after initialization.
*/

#ifndef OPTPARSE_IMPLEMENTATION
Copy link

@ShamrockLee ShamrockLee Dec 31, 2021

Choose a reason for hiding this comment

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

It doesn't make sense to exclude function declarations and macro definitions when implementation is asked for.

AFAIK, forward declaration is a good practice when writing C. It not only guarentees the consistency between the header and the implementation, but also enables calling another function defined below the current one.

#define TCHAR char
#define _TEXT(x) x
#endif

Copy link

@ShamrockLee ShamrockLee Dec 31, 2021

Choose a reason for hiding this comment

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

Are TCHAR and TEXT() macros still relevent? Could TCHAR be converted to int implicitly?
I'm not familiar with Windows. Please feal free to correct me.

https://docs.microsoft.com/en-us/windows/win32/learnwin32/working-with-strings

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