-
Notifications
You must be signed in to change notification settings - Fork 85
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
Avoid umbrella header crash error in remote compilation when no default umbrella header generated #897
Merged
Merged
Avoid umbrella header crash error in remote compilation when no default umbrella header generated #897
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,8 +142,9 @@ def _write_umbrella_header( | |
module_name = name | ||
|
||
content = "" | ||
|
||
extern_keyword = "extern" | ||
if generate_default_umbrella_header: | ||
extern_keyword = "FOUNDATION_EXPORT" | ||
content += """\ | ||
#ifdef __OBJC__ | ||
# import <Foundation/Foundation.h> | ||
|
@@ -165,13 +166,13 @@ def _write_umbrella_header( | |
for header in public_headers: | ||
content += "#import \"{header}\"\n".format(header = paths.basename(header)) | ||
|
||
if generate_default_umbrella_header: | ||
content += """ | ||
FOUNDATION_EXPORT double {module_name}VersionNumber; | ||
FOUNDATION_EXPORT const unsigned char {module_name}VersionString[]; | ||
content += """ | ||
{extern_keyword} double {module_name}VersionNumber; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice findings! |
||
{extern_keyword} const unsigned char {module_name}VersionString[]; | ||
""".format( | ||
module_name = module_name, | ||
) | ||
extern_keyword = extern_keyword, | ||
module_name = module_name, | ||
) | ||
|
||
write_file( | ||
name = basename + "~", | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we always keep the else clause so that we always use FOUNDATION_EXPORT. It will be something like
Or something like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will end having
error: unknown type name 'FOUNDATION_EXPORT'
error if we also replaceextern
withFOUNDATION_EXPORT
.this is because when generate_default_umbrella_header is off and the code has
ifdef __OBJC__
is true, you won't get the FOUNDATION_EXPORT macro defined.If we add just
we end up having the
warning: ambiguous expansion of macro 'FOUNDATION_EXPORT' error.
which is sth i don't wantThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's weird. Could it be that we need to always
define FOUNDATION_EXPORT extern
whenifdef __OBJC__
is true (even if defined(__cplusplus) is true)? Could you tryThat's essentially your current logic so not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly, might as well be very explicit about the two code path this is going with