-
Notifications
You must be signed in to change notification settings - Fork 1.2k
CoreFoundation: handle LLP64 as LP64 #1808
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
Conversation
@swift-ci please test |
@@ -9,6 +9,7 @@ | |||
Original author: Zhi Feng Huang | |||
*/ | |||
|
|||
#include <CoreFoundation/TargetConditionals.h> |
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.
We cant do this since it only exists on non-darwin platforms. The Darwin variant is just <TargetConditionals.h> additionally the proper TargetConditionals header should be included by CFBase.h so any additions should not be needed.
This applies to all other instances of the addition of this header.
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.
even though TARGET_RT_64_BIT is ok, the CoreFoundation/TargetConditionals thing still holds. These header includes would be a breaking change for cycling back to the Darwin implementation.
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.
Okay, I'll adjust the sites to use CFBase.h
instead. The locations that I included this header were not already including CFBase.h
.
@@ -229,7 +229,7 @@ extern void __CFGenericValidateType_(CFTypeRef cf, CFTypeID type, const char *fu | |||
#define __CFBitfield64GetValue(V, N1, N2) (((V) & __CFBitfield64Mask(N1, N2)) >> (N2)) | |||
#define __CFBitfield64SetValue(V, N1, N2, X) ((V) = ((V) & ~__CFBitfield64Mask(N1, N2)) | ((((uint64_t)X) << (N2)) & __CFBitfield64Mask(N1, N2))) | |||
|
|||
#if __LP64__ || DEPLOYMENT_TARGET_ANDROID | |||
#if TARGET_RT_64_BIT || DEPLOYMENT_TARGET_ANDROID |
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.
TARGET_ are usually only from TargetConditionals.h which CoreFoundation does not control on Darwin. So we probably need to first define something along the lines of CFRUNTIME_64BIT. Additionally this should be defined if it does not get defined in a public header; CFBase.h is a good spot to do this.
#ifndef CFRUNTIME_64BIT
#if __LLP64__ || __LP64__
#define CFRUNTIME_64BIT 1
#else
#define CFRUNTIME_64BIT 0
#endif
#endif
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.
hmm I take that back: TARGET_RT_64_BIT is defined by TargetConditionals on Darwin.
Do we have that defined in <CoreFoundation/TargetConditionals.h>?
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.
Yes, that is defined in the <CoreFoundation/TargetConditionals.h>
header.
a932fea
to
b139b43
Compare
@swift-ci please test |
@phausler - does this look good now? or are there other changes to be made? |
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.
looks good to me
Adjust the various sites that consider LP64 to also consider LLP64 environments. This is needed to support Windows x86_64. Normalize the checks across the code base to use `TARGET_RT_64_BIT` which is defined in TargetConditionals.h.
b139b43
to
a742bac
Compare
@swift-ci please test and merge |
Adjust the various sites that consider LP64 to also consider LLP64
environments. This is needed to support Windows x86_64. Normalize the checks
across the code base to use
TARGET_RT_64_BIT
which is defined inTargetConditionals.h.