main/psqlodbc: fix build with gcc 15

Fix bool typedef errors.

```
In file included from info.c:19:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from bind.h:12,
                 from bind.c:19:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
```
This commit is contained in:
mio 2025-08-02 02:34:22 +00:00
parent f2624a565b
commit 82163475fc
2 changed files with 50 additions and 2 deletions

View File

@ -1,14 +1,16 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=psqlodbc
pkgver=16.00.0005
pkgrel=0
pkgrel=1
_pkgver="${pkgver//./_}"
pkgdesc="PostgreSQL ODBC driver"
url="https://odbc.postgresql.org/"
arch="all"
license="GPL-2.0-or-later"
makedepends="libpq-dev unixodbc-dev libtool autoconf automake"
source="$pkgname-$pkgver.tar.gz::https://github.com/postgresql-interfaces/psqlodbc/archive/REL-$_pkgver.tar.gz"
source="$pkgname-$pkgver.tar.gz::https://github.com/postgresql-interfaces/psqlodbc/archive/REL-$_pkgver.tar.gz
gcc15-configure-stdbool.patch
"
builddir="$srcdir/psqlodbc-REL-$_pkgver"
prepare() {
@ -34,4 +36,5 @@ package() {
sha512sums="
61f4696ed5ab7b0e1b584faa73af997cd1685ad632de8bfe079854fed06e3aa79f0e4a7a7564a8fe96e87f338a54e7dbc2c5baccd440716e351038fc89b1c613 psqlodbc-16.00.0005.tar.gz
8a27072e4b0ff14d0637cf11f76e4d0b52c1d11e15eb9a270304d1343249475d13cfb438a833e01eb309c479133fe6b39e716f0cc6cfb9f89e4fdb65725e11d3 gcc15-configure-stdbool.patch
"

View File

@ -0,0 +1,45 @@
Patch-Source: https://github.com/postgresql-interfaces/psqlodbc/commit/c8cb6cfc5bad70f0b690a03a2401fdba6906860f
---
From c8cb6cfc5bad70f0b690a03a2401fdba6906860f Mon Sep 17 00:00:00 2001
From: Martin 'JaMa' Jansa <Martin.Jansa@gmail.com>
Date: Thu, 24 Apr 2025 12:57:35 +0200
Subject: [PATCH] configure: make sure to call AC_CHECK_HEADER_STDBOOL (#112)
before using ac_cv_sizeof_bool
It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:
ac_cv_header_stdbool_h=yes
ac_cv_sizeof_bool=1
ac_cv_type__Bool=yes
#define SIZEOF_BOOL 1
#define HAVE__BOOL 1
#define HAVE_STDBOOL_H 1
* fixes:
https://github.com/postgresql-interfaces/psqlodbc/issues/110
https://github.com/postgresql-interfaces/psqlodbc/issues/94
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
configure.ac | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index f35c8258..ea363caf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,9 +28,11 @@ AC_CHECK_SIZEOF([bool], [],
#include <stdbool.h>
#endif])
+AC_CHECK_HEADER_STDBOOL()
+
dnl We use <stdbool.h> if we have it and it declares type bool as having
dnl size 1. Otherwise, c.h will fall back to declaring bool as unsigned char.
-if test "$ac_cv_header_stdbool_h" = yes -a "$ac_cv_sizeof_bool" = 1; then
+if test "$ac_cv_header_stdbool_h" = yes && test "$ac_cv_sizeof_bool" = 1; then
AC_DEFINE([PG_USE_STDBOOL], 1,
[Define to 1 to use <stdbool.h> to define type bool.])
fi