logo

utils-std

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

reallocarray.h (535B)


  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. #if __NetBSD_Version__ < 1000000000
  11. #define _OPENBSD_SOURCE
  12. #endif
  13. #endif
  14. #include <stdlib.h> // reallocarray