Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1463)

Unified Diff: test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc

Issue 10451028: Add support for GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO to xcode emulation. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: grrrr Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mac/xcode-gcc/test.gyp ('k') | test/mac/xcode-gcc/warn_about_missing_newline.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc
===================================================================
--- test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc (revision 0)
+++ test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc (revision 0)
@@ -0,0 +1,15 @@
+// Copyright (c) 2012 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#define offsetof(st, m) ((unsigned)((char*)&((st*)0)->m - (char*)0))
+
+struct MyStruct {
+ virtual void MyFunc() = 0;
+ int my_member;
+};
+
+int main() {
+ unsigned x = offsetof(MyStruct, my_member);
+ return x ? 0 : 1;
+}
Property changes on: test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « test/mac/xcode-gcc/test.gyp ('k') | test/mac/xcode-gcc/warn_about_missing_newline.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698