head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2026.10.19.23.51.13; author gutteridge; state Exp; branches; next 1.1; commitid exP3lkgZQR1j590H; 1.1 date 2026.10.19.23.09.37; author gutteridge; state Exp; branches; next ; commitid rAZuE1lOOKUZP80H; desc @@ 1.2 log @librep: note upstream version of some build fixes (There actually is an upstream still, it just hasn't released anything since 2017, and its main archive site is no longer functioning. Their patching here is basically the same as what was already committed.) @ text @$NetBSD: patch-configure.ac,v 1.1 2026/10/19 23:09:37 gutteridge Exp $ Modernize C tests to fix builds with GCC >= 14. https://github.com/SawfishWM/librep/commit/48f557ab34d47a7a1fd9e8425542f720be40946e --- configure.ac.orig 2017-08-25 19:59:05.000000000 +0000 +++ configure.ac @@@@ -432,15 +432,18 @@@@ if test "${with_value_type}" = "undef"; then as a pointer. [TYPE=] (see README)], [], [with_value_type="undef"]) if test "${with_value_type}" = "undef"; then - AC_TRY_RUN([main () { exit (!(sizeof (int) >= sizeof (void *)));}], + AC_TRY_RUN([#include + int main () { exit (!(sizeof (int) >= sizeof (void *)));}], [with_value_type=int]) fi if test "${with_value_type}" = "undef"; then - AC_TRY_RUN([main () { exit (!(sizeof (long int) >= sizeof (void *)));}], + AC_TRY_RUN([#include + int main () { exit (!(sizeof (long int) >= sizeof (void *)));}], [with_value_type="long int"]) fi if test "${with_value_type}" = "undef"; then - AC_TRY_RUN([main () { exit (!(sizeof (long long int) >= sizeof (void *)));}], + AC_TRY_RUN([#include + int main () { exit (!(sizeof (long long int) >= sizeof (void *)));}], [with_value_type="long long int"]) fi if test "${with_value_type}" = "undef"; then @@@@ -457,7 +460,8 @@@@ if test "${with_value_sizeof}" = "undef"; then if test "${with_value_sizeof}" = "undef"; then dnl the following fragment is inspired by AC_CHECK_SIZEOF AC_TRY_RUN([#include - main () { + #include + int main () { FILE *f = fopen ("conftestval", "w"); if (!f) exit (1); fprintf (f, "%d\n", sizeof (${with_value_type})); @@@@ -548,7 +552,8 @@@@ if test "${with_stack_direction}" = unknown; then esac fi if test "${with_stack_direction}" = unknown; then - AC_TRY_RUN([ int level = 1; + AC_TRY_RUN([ #include + int level = 1; void inner (char *foo) { char bar; if (level) { --level; inner (foo); } exit (!(foo >= &bar)); } @ 1.1 log @librep: fix builds with GCC >= 14 Tested on NetBSD 11.99.9 with GCC 14.4.0 and Fedora Linux 44 with GCC 16.2.1. (Given the configure script was generated from a significantly older version of autoconf, and the upstream appears to be gone, patching is applied directly against it for the minimal diff, but an equivalent change to configure.ac is included, should it be useful to someone.) @ text @d1 1 a1 1 $NetBSD$ d4 1 @