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

Fix header file guards and replace reserved identifiers #531

Merged
merged 3 commits into from
Dec 15, 2016

Conversation

stweil
Copy link
Member

@stweil stweil commented Dec 4, 2016

No description provided.

Use macro names as suggested by the Google C++ Style Guide
(https://google.github.io/styleguide/cppguide.html#The__define_Guard).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Some guards were missing, others were not the first statement.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This fixes a compiler warning from clang:

ccutil/platform.h:88:13: warning:
 macro name is a reserved identifier [-Wreserved-id-macro]
    #define _TESS_FILE_BASENAME_                                            \

Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil
Copy link
Member Author

stweil commented Dec 4, 2016

This also fixes issue #96.

@egorpugin
Copy link
Contributor

What about moving to #pragma once?

@amitdo
Copy link
Collaborator

amitdo commented Dec 4, 2016

What about moving to #pragma once?

https://google.github.io/styleguide/cppguide.html

Do not use #pragma once; instead use the standard Google include guards. The path in the include guards should be relative to the top of your project tree.

@egorpugin
Copy link
Contributor

Ah,ok. No objections in this case.

@stweil
Copy link
Member Author

stweil commented Dec 4, 2016

#pragma once is widely supported, but not a standard, while the include guards using macros only use standard code. Modern compilers like gcc or clang know include guards, so for those compilers #pragma once has no performance advantage.

@egorpugin
Copy link
Contributor

But less to write :)

@stweil
Copy link
Member Author

stweil commented Dec 4, 2016

True.

@stweil
Copy link
Member Author

stweil commented Dec 12, 2016

@zdenop, I think this PR is ready to get merged. Issue #96 can be closed then.

@zdenop zdenop merged commit da4c064 into tesseract-ocr:master Dec 15, 2016
@stweil stweil deleted the guards branch December 15, 2016 08:26
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.

4 participants