logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

reallocarray.h (569B)


  1. // utils-std: Collection of commonly available Unix tools
  2. // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. // SPDX-License-Identifier: 0BSD
  4. #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 202405L
  5. #error reallocarray needs: define _POSIX_C_SOURCE 202405L
  6. #endif
  7. // pre-POSIX.1-2024 reallocarray fallback
  8. #if !defined(_POSIX_VERSION) || _POSIX_VERSION < 202405L
  9. #define _BSD_SOURCE
  10. // FreeBSD
  11. #undef _POSIX_C_SOURCE
  12. #if __NetBSD_Version__ < 1000000000
  13. #define _OPENBSD_SOURCE
  14. #endif
  15. #endif
  16. #include <stdlib.h> // reallocarray