git: 08d6ba6fa1dd - main - biology/biosig: fix build with libc++ 19

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Fri, 11 Oct 2024 17:31:13 UTC
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=08d6ba6fa1dddca87fb19366370f0eb06c6aac21

commit 08d6ba6fa1dddca87fb19366370f0eb06c6aac21
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-10-09 18:57:33 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-10-11 17:30:49 +0000

    biology/biosig: fix build with libc++ 19
    
    With libc++ 19, biology/biosig fails to compile, with errors similar to:
    
      /usr/include/c++/v1/__math/special_functions.h:51:16: error: expected unqualified-id
         51 |   if (!__math::isfinite(__H_n)) {
            |                ^
      ./t230/../biosig-dev.h:932:22: note: expanded from macro 'isfinite'
        932 | # define isfinite(a) (-INFINITY < (a) && (a) < INFINITY)
            |                      ^
    
    This is because biosig attempts to define its own isfinite() macro,
    which it should not do. Stub out the incompatible definition.
    
    PR:             281976
    Approved by:    yuri (maintainer)
    MFH:            2024Q4
---
 biology/biosig/files/patch-biosig4c++_biosig-dev.h | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/biology/biosig/files/patch-biosig4c++_biosig-dev.h b/biology/biosig/files/patch-biosig4c++_biosig-dev.h
index 8a489fdfc0db..9ca61e910c80 100644
--- a/biology/biosig/files/patch-biosig4c++_biosig-dev.h
+++ b/biology/biosig/files/patch-biosig4c++_biosig-dev.h
@@ -1,4 +1,4 @@
---- biosig4c++/biosig-dev.h.orig	2022-10-08 10:54:15 UTC
+--- biosig4c++/biosig-dev.h.orig	2024-08-03 10:06:47 UTC
 +++ biosig4c++/biosig-dev.h
 @@ -35,6 +35,8 @@
  #include <time.h>
@@ -9,16 +9,25 @@
  
  #ifdef __cplusplus
  extern "C" {
-@@ -549,6 +551,12 @@ HDRTYPE* sopen_extended(const char* FileName, const ch
- #elif defined(__linux__) 
+@@ -550,6 +552,12 @@ HDRTYPE* sopen_extended(const char* FileName, const ch
  #  include <endian.h>
  #  include <byteswap.h>
-+
+ 
 +#elif defined(__FreeBSD__) 
 +#  include <machine/endian.h>
 +#  define __BIG_ENDIAN _BIG_ENDIAN
 +#  define __LITTLE_ENDIAN _LITTLE_ENDIAN
 +#  define __BYTE_ORDER _BYTE_ORDER
- 
++
  #elif defined(__FreeBSD__)
  #  include <machine/endian.h>
+ 
+@@ -920,7 +928,7 @@ static inline void bef64a(  double i, void* r) {
+ #ifndef INFINITY
+ # define INFINITY (1.0/0.0)   /* positive infinity */
+ #endif
+-#ifndef isfinite
++#if 0
+ # define isfinite(a) (-INFINITY < (a) && (a) < INFINITY)
+ #endif
+