0001-Fix-compatibility-with-C23-compilers.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From ae940946473ceb8c5353bc6e7f04673c6e60502d Mon Sep 17 00:00:00 2001
  2. From: Alex Cherepanov <alex@coscript.biz>
  3. Date: Thu, 3 Apr 2025 17:19:41 +0100
  4. Subject: Bug 708160: Fix compatibility with C23 compilers
  5. Upstream: https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=ae940946473ceb8c5353bc6e7f04673c6e60502d
  6. [thomas: Only backport the bool typedef condition]
  7. Signed-off-by: Thomas Perale <thomas.perale@mind.be>
  8. ---
  9. base/stdpre.h | 6 ++++--
  10. 1 files changed, 4 insertions(+), 2 deletions(-)
  11. diff --git a/base/stdpre.h b/base/stdpre.h
  12. index dda30b6a4..2f9c84e0d 100644
  13. --- a/base/stdpre.h
  14. +++ b/base/stdpre.h
  15. @@ -1,4 +1,4 @@
  16. -/* Copyright (C) 2001-2023 Artifex Software, Inc.
  17. +/* Copyright (C) 2001-2025 Artifex Software, Inc.
  18. All Rights Reserved.
  19. This software is provided AS-IS with no warranty, either express or
  20. @@ -341,7 +341,9 @@ typedef signed char schar;
  21. * and the MetroWerks C++ compiler insists that bool be equivalent to
  22. * unsigned char.
  23. */
  24. -#ifndef __cplusplus
  25. +
  26. +/* C23 has bool as a builtin type. */
  27. +#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L)
  28. #ifdef __BEOS__
  29. typedef unsigned char bool;
  30. #else
  31. --
  32. cgit v1.2.3