From: Dmitry Bogatov <[email protected]>
---
module/system/foreign/declarative.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/module/system/foreign/declarative.scm
b/module/system/foreign/declarative.scm
index b0c31a0..62d40b8 100644
--- a/module/system/foreign/declarative.scm
+++ b/module/system/foreign/declarative.scm
@@ -132,9 +132,18 @@
(define (make-c-function-name symbol)
(define function-name (symbol->string symbol))
+ (define (replace-hyphen c)
+ (if (eqv? c #\-)
+ #\_
+ c))
+ (define (c-identifier-char? c)
+ (or (char-alphabetic? c)
+ (char-numeric? c)
+ (eqv? c #\_)))
(when (string-prefix? "c-" function-name)
(set! function-name (string-drop function-name 2)))
- function-name)
+ (string-map! replace-hyphen function-name)
+ (string-filter c-identifier-char? function-name))
(define *validate-function-name* (make-parameter #f))
(define *validate-argument-name* (make-parameter #f))
--
I may be not subscribed. Please, keep me in carbon copy.