Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* -*- buffer-read-only: t -*- vi: set ro: */ 00002 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 00003 /* Determine alignment of types. 00004 Copyright (C) 2003-2004, 2006, 2009-2011 Free Software Foundation, Inc. 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 3, or (at your option) 00009 any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software Foundation, 00018 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 00019 00020 #ifndef _ALIGNOF_H 00021 #define _ALIGNOF_H 00022 00023 #include <stddef.h> 00024 00025 /* Determine the alignment of a structure slot (field) of a given type, 00026 at compile time. Note that the result depends on the ABI. 00027 Note: The result cannot be used as a value for an 'enum' constant, 00028 due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */ 00029 #if defined __cplusplus 00030 template <class type> struct alignof_helper { char __slot1; type __slot2; }; 00031 # define alignof_slot(type) offsetof (alignof_helper<type>, __slot2) 00032 #else 00033 # define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) 00034 #endif 00035 00036 /* Determine the good alignment of a object of the given type at compile time. 00037 Note that this is not necessarily the same as alignof_slot(type). 00038 For example, with GNU C on x86 platforms: alignof_type(double) = 8, but 00039 - when -malign-double is not specified: alignof_slot(double) = 4, 00040 - when -malign-double is specified: alignof_slot(double) = 8. 00041 Note: The result cannot be used as a value for an 'enum' constant, 00042 due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */ 00043 #if defined __GNUC__ 00044 # define alignof_type __alignof__ 00045 #else 00046 # define alignof_type alignof_slot 00047 #endif 00048 00049 /* alignof is an alias for alignof_slot semantics, since that's what most 00050 callers need. 00051 Note: The result cannot be used as a value for an 'enum' constant, 00052 due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */ 00053 #define alignof alignof_slot 00054 00055 #endif /* _ALIGNOF_H */