From 51577cbb60250ac3ac18f8e7ebce711b16b58e80 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Sun, 23 Oct 2016 20:07:45 +0000 Subject: [PATCH] Issue #126 - Selectively compile AI_ALL and AI_V4MAPPED --- CHANGELOG.md | 4 ++++ srfi/106.sld | 23 +++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd902ac8..28cac1a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ TODO: more performance improvements TODO: SRFI 113 +Bug Fixes + +- Modified SRFI 106 to be smarter about compiling `AI_V4MAPPED` and `AI_ALL`, which are not defined on OpenBSD. + # 0.3 - October 22, 2016 Features: diff --git a/srfi/106.sld b/srfi/106.sld index 9fb1a8d8..3a9315d0 100644 --- a/srfi/106.sld +++ b/srfi/106.sld @@ -377,8 +377,27 @@ (make-const sock-dgram "SOCK_DGRAM" ) (make-const ai-canonname "AI_CANONNAME" ) (make-const ai-numerichost "AI_NUMERICHOST") - (make-const ai-v4mapped "AI_V4MAPPED" ) - (make-const ai-all "AI_ALL" ) + ;; The next 2 are not defined on all platforms: + (define *ai-v4mapped* (ai-v4mapped)) + (define-c ai-v4mapped + "(void *data, int argc, closure _, object k)" + " +#ifdef AI_V4MAPPED + return_closcall1(data, k, obj_int2obj(AI_V4MAPPED)); +#else + Cyc_rt_raise_msg(data, \"AI_V4MAPPED is not available on this platform\"); +#endif + ") + (define *ai-all* (ai-all)) + (define-c ai-all + "(void *data, int argc, closure _, object k)" + " +#ifdef AI_ALL + return_closcall1(data, k, obj_int2obj(AI_ALL)); +#else + Cyc_rt_raise_msg(data, \"AI_ALL is not available on this platform\"); +#endif + ") (make-const ai-addrconfig "AI_ADDRCONFIG" ) (make-const msg-peek "MSG_PEEK" ) (make-const msg-oob "MSG_OOB" )