From 4f677fd157baacd41383761f4bb8c33636a5f3f7 Mon Sep 17 00:00:00 2001 From: Pierre Chifflier Date: Mon, 19 Jun 2017 13:20:07 +0200 Subject: [PATCH] Rust gen-c-headers: keep 'const' attribute --- rust/gen-c-headers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rust/gen-c-headers.py b/rust/gen-c-headers.py index fe96e3fd2f..3200ad3309 100755 --- a/rust/gen-c-headers.py +++ b/rust/gen-c-headers.py @@ -99,12 +99,14 @@ def convert_type(rs_type): if mod in [ "*mut", "* mut", - "*const", - "* const", "&mut", "&'static mut", ]: return "%s *" % (type_map[rtype]) + elif mod in [ + "*const", + "* const"]: + return "const %s *" % (type_map[rtype]) elif mod in [ "*mut *const", "*mut*const"]: -- 2.47.2