guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] branch main updated: Support C99 complex types condition


From: Mikael Djurfeldt
Subject: [Guile-commits] branch main updated: Support C99 complex types conditionally in (system foreign)
Date: Wed, 01 Dec 2021 12:44:49 -0500

This is an automated email from the git hooks/post-receive script.

mdj pushed a commit to branch main
in repository guile.

The following commit(s) were added to refs/heads/main by this push:
     new 6af3362  Support C99 complex types conditionally in (system foreign)
6af3362 is described below

commit 6af3362b059bb132231354ccca7f15c781f50f48
Author: Mikael Djurfeldt <mikael@djurfeldt.com>
AuthorDate: Wed Dec 1 18:40:19 2021 +0100

    Support C99 complex types conditionally in (system foreign)
    
    496f69dba2fdf1720b40349932fcdecd444107c3 introduced C99 complex types in
    libguile/foreign.h and (system foreign). Since these types are provided
    conditionally in foreign.h based on autoconf tests they need to be used
    conditionally in (system foreign) based on their presence.
---
 module/system/foreign.scm | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/module/system/foreign.scm b/module/system/foreign.scm
index 4458dc7..7fdd6dd 100644
--- a/module/system/foreign.scm
+++ b/module/system/foreign.scm
@@ -108,8 +108,12 @@
 (define *writers*
   `((,float . ,bytevector-ieee-single-native-set!)
     (,double . ,bytevector-ieee-double-native-set!)
-    (,complex-float . ,(writer-complex bytevector-ieee-single-native-set! 
(sizeof float)))
-    (,complex-double . ,(writer-complex bytevector-ieee-double-native-set! 
(sizeof double)))
+    ,@(if (defined? 'complex-float)
+          `((,complex-float
+             . ,(writer-complex bytevector-ieee-single-native-set! (sizeof 
float)))
+            (,complex-double
+             . ,(writer-complex bytevector-ieee-double-native-set! (sizeof 
double))))
+          '())
     (,int8 . ,bytevector-s8-set!)
     (,uint8 . ,bytevector-u8-set!)
     (,int16 . ,bytevector-s16-native-set!)
@@ -123,8 +127,12 @@
 (define *readers*
   `((,float . ,bytevector-ieee-single-native-ref)
     (,double . ,bytevector-ieee-double-native-ref)
-    (,complex-float . ,(reader-complex bytevector-ieee-single-native-ref 
(sizeof float)))
-    (,complex-double . ,(reader-complex bytevector-ieee-double-native-ref 
(sizeof double)))
+    ,@(if (defined? 'complex-float)
+          `((,complex-float
+             . ,(reader-complex bytevector-ieee-single-native-ref (sizeof 
float)))
+            (,complex-double
+             . ,(reader-complex bytevector-ieee-double-native-ref (sizeof 
double))))
+          '())
     (,int8 . ,bytevector-s8-ref)
     (,uint8 . ,bytevector-u8-ref)
     (,int16 . ,bytevector-s16-native-ref)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]