diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-03-02 01:19:04 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-03-02 01:19:04 +0000 |
commit | df496529b7009d6e58f335926884200b38d27687 (patch) | |
tree | 9fc0c6d66e0a8f426bb7915067f22113e8be856f /lib/Frontend/RewriteObjC.cpp | |
parent | d2b43bf9116dad3d4ff3815590ef10f733d08289 (diff) |
Cast a pointer to 'long long' to satisfy all compilation models.
Satisfies radar 7703202.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97532 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | lib/Frontend/RewriteObjC.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp index 98dee264e9..a13bccbb91 100644 --- a/lib/Frontend/RewriteObjC.cpp +++ b/lib/Frontend/RewriteObjC.cpp @@ -640,7 +640,9 @@ void RewriteObjC::Initialize(ASTContext &context) { Preamble += "#define __block\n"; Preamble += "#define __weak\n"; } - Preamble += "\n#define __OFFSETOFIVAR__(TYPE, MEMBER) ((long) &((TYPE *)0)->MEMBER)\n"; + // NOTE! Windows uses LLP64 for 64bit mode. So, cast pointer to long long + // as this avoids warning in any 64bit/32bit compilation model. + Preamble += "\n#define __OFFSETOFIVAR__(TYPE, MEMBER) ((long long) &((TYPE *)0)->MEMBER)\n"; } |