stddef.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*-------------------------------------------------------------------------
  2. stddef.h - ANSI functions forward declarations
  3. Copyright (C) 2004, Maarten Brock / sourceforge.brock@dse.nl
  4. Copyright (C) 2011, Philipp Klaus Krause / pkk@spth.de
  5. This library is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License as published by the
  7. Free Software Foundation; either version 2, or (at your option) any
  8. later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this library; see the file COPYING. If not, write to the
  15. Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
  16. MA 02110-1301, USA.
  17. As a special exception, if you link this library with other files,
  18. some of which are compiled with SDCC, to produce an executable,
  19. this library does not by itself cause the resulting executable to
  20. be covered by the GNU General Public License. This exception does
  21. not however invalidate any other reasons why the executable file
  22. might be covered by the GNU General Public License.
  23. -------------------------------------------------------------------------*/
  24. #ifndef __SDCC_STDDEF_H
  25. #define __SDCC_STDDEF_H 1
  26. #ifndef NULL
  27. #define NULL (void *)0
  28. #endif
  29. #ifndef __PTRDIFF_T_DEFINED
  30. #define __PTRDIFF_T_DEFINED
  31. #if defined (__SDCC_mcs51) || defined (__SDCC_ds390)
  32. typedef long int ptrdiff_t;
  33. #else
  34. typedef int ptrdiff_t;
  35. #endif
  36. #endif
  37. #ifndef __SIZE_T_DEFINED
  38. #define __SIZE_T_DEFINED
  39. typedef unsigned int size_t;
  40. #endif
  41. #ifndef __WCHAR_T_DEFINED
  42. #define __WCHAR_T_DEFINED
  43. typedef char wchar_t;
  44. #endif
  45. /* Bounds-checking interfaces from annex K of the C11 standard. */
  46. #if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__
  47. #ifndef __RSIZE_T_DEFINED
  48. #define __RSIZE_T_DEFINED
  49. typedef size_t rsize_t;
  50. #endif
  51. #ifndef __ERRNO_T_DEFINED
  52. #define __ERRNO_T_DEFINED
  53. typedef int errno_t;
  54. #endif
  55. #endif
  56. #define offsetof(s, m) __builtin_offsetof (s, m)
  57. #endif