boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

stddef.h (1440B)


      1 /* -*-comment-start: "//";comment-end:""-*-
      2  * GNU Mes --- Maxwell Equations of Software
      3  * Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
      4  * Copyright © 2021 Danny Milosavljevic <dannym@scratchpost.org>
      5  *
      6  * This file is part of GNU Mes.
      7  *
      8  * GNU Mes is free software; you can redistribute it and/or modify it
      9  * under the terms of the GNU General Public License as published by
     10  * the Free Software Foundation; either version 3 of the License, or (at
     11  * your option) any later version.
     12  *
     13  * GNU Mes is distributed in the hope that it will be useful, but
     14  * WITHOUT ANY WARRANTY; without even the implied warranty of
     15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16  * GNU General Public License for more details.
     17  *
     18  * You should have received a copy of the GNU General Public License
     19  * along with GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
     20  */
     21 #ifndef __MES_STDDEF_H
     22 #define __MES_STDDEF_H 1
     23 
     24 #if SYSTEM_LIBC
     25 #undef __MES_STDDEF_H
     26 #include_next <stddef.h>
     27 #else // ! SYSTEM_LIBC
     28 
     29 #include <sys/types.h>
     30 #include <stdint.h>
     31 #include <unistd.h>
     32 
     33 #ifndef offsetof
     34 #if __MESC__
     35 #define offsetof(type, field) (&((type *)0)->field)
     36 #else // !__MESC__
     37 #define offsetof(type, field) ((size_t)&((type *)0)->field)
     38 #endif // !__MESC__
     39 #endif // offsetof
     40 
     41 /* Note: on banana gcc, max_align_t is 16 Byte big instead! */
     42 
     43 typedef double max_align_t;
     44 
     45 #endif // ! SYSTEM_LIBC
     46 
     47 #endif // __MES_STDDEF_H