Kurt Mosiejczuk <k...@cranky.work> writes:

> databases/pspg fails to build on sparc64 with:
> src/args.c: In function 'print_versions':
> src/args.c:262: error: '__SIZEOF_WCHAR_T__' undeclared (first use in this 
> function)
> src/args.c:262: error: (Each undeclared identifier is reported only once
> src/args.c:262: error: for each function it appears in.)
>
> Swapping COMPILER to base-clang pors-gcc fixes the build on sparc64.
>
> ok?

I'm fine with it, but since the tool is mostly C99 it'd be a shame to
switch to ports-gcc.  What about the attached patch?  I can successfully
build it on amd64 with gcc installed from /usr/src.


Index: Makefile
===================================================================
RCS file: /cvs/ports/databases/pspg/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile    14 Dec 2021 09:42:35 -0000      1.5
+++ Makefile    5 Jan 2022 09:03:11 -0000
@@ -2,6 +2,7 @@
 
 COMMENT =      UNIX pager optimized for tabular data
 
+REVISION =     0
 GH_ACCOUNT =   okbob
 GH_PROJECT =   pspg
 GH_TAGNAME =   5.5.3
Index: patches/patch-src_args_c
===================================================================
RCS file: patches/patch-src_args_c
diff -N patches/patch-src_args_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_args_c    5 Jan 2022 09:03:11 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+gcc: error: '__SIZEOF_WCHAR_T__' undeclared
+
+Index: src/args.c
+--- src/args.c.orig
++++ src/args.c
+@@ -259,7 +259,7 @@ print_versions(void)
+ 
+ #endif
+ 
+-      fprintf(stdout, "wchar_t width: %d, max: %d\n", __SIZEOF_WCHAR_T__, 
__WCHAR_MAX__);
++      fprintf(stdout, "wchar_t width: %d, max: %d\n", sizeof(wchar_t), 
__WCHAR_MAX__);
+ 
+ #ifdef HAVE_POSTGRESQL
+ 

Reply via email to