From 727324fd7342140e6fc2e959c3898991d74f0c24 Mon Sep 17 00:00:00 2001
From: jD91mZM2 <me@krake.one>
Date: Tue, 26 Jun 2018 16:54:31 +0200
Subject: [PATCH] Apparently cbindgen works on constants

---
 src/signal/src/lib.rs   |  6 +--
 src/signal/src/linux.rs | 84 ++++++++++++++++++++---------------------
 src/signal/src/redox.rs | 76 ++++++++++++++++++-------------------
 3 files changed, 83 insertions(+), 83 deletions(-)

diff --git a/src/signal/src/lib.rs b/src/signal/src/lib.rs
index a59a1369..7195c5ff 100644
--- a/src/signal/src/lib.rs
+++ b/src/signal/src/lib.rs
@@ -12,9 +12,9 @@ pub mod sys;
 #[path = "redox.rs"]
 pub mod sys;
 
-#[no_mangle] pub static SIG_BLOCK: c_int = 0;
-#[no_mangle] pub static SIG_UNBLOCK: c_int = 1;
-#[no_mangle] pub static SIG_SETMASK: c_int = 2;
+pub const SIG_BLOCK:   c_int = 0;
+pub const SIG_UNBLOCK: c_int = 1;
+pub const SIG_SETMASK: c_int = 2;
 
 pub use sys::*;
 
diff --git a/src/signal/src/linux.rs b/src/signal/src/linux.rs
index d5ebf092..628e8133 100644
--- a/src/signal/src/linux.rs
+++ b/src/signal/src/linux.rs
@@ -3,46 +3,46 @@ pub struct sys_sigset_t {
     pub bits: [u64; 16],
 }
 
-#[no_mangle] pub static SIGHUP: usize = 1;
-#[no_mangle] pub static SIGINT: usize = 2;
-#[no_mangle] pub static SIGQUIT: usize = 3;
-#[no_mangle] pub static SIGILL: usize = 4;
-#[no_mangle] pub static SIGTRAP: usize = 5;
-#[no_mangle] pub static SIGABRT: usize = 6;
-#[no_mangle] pub static SIGIOT: usize = 6;
-#[no_mangle] pub static SIGBUS: usize = 7;
-#[no_mangle] pub static SIGFPE: usize = 8;
-#[no_mangle] pub static SIGKILL: usize = 9;
-#[no_mangle] pub static SIGUSR1: usize = 10;
-#[no_mangle] pub static SIGSEGV: usize = 11;
-#[no_mangle] pub static SIGUSR2: usize = 12;
-#[no_mangle] pub static SIGPIPE: usize = 13;
-#[no_mangle] pub static SIGALRM: usize = 14;
-#[no_mangle] pub static SIGTERM: usize = 15;
-#[no_mangle] pub static SIGSTKFLT: usize = 16;
-#[no_mangle] pub static SIGCHLD: usize = 17;
-#[no_mangle] pub static SIGCONT: usize = 18;
-#[no_mangle] pub static SIGSTOP: usize = 19;
-#[no_mangle] pub static SIGTSTP: usize = 20;
-#[no_mangle] pub static SIGTTIN: usize = 21;
-#[no_mangle] pub static SIGTTOU: usize = 22;
-#[no_mangle] pub static SIGURG: usize = 23;
-#[no_mangle] pub static SIGXCPU: usize = 24;
-#[no_mangle] pub static SIGXFSZ: usize = 25;
-#[no_mangle] pub static SIGVTALRM: usize = 26;
-#[no_mangle] pub static SIGPROF: usize = 27;
-#[no_mangle] pub static SIGWINCH: usize = 28;
-#[no_mangle] pub static SIGIO: usize = 29;
-#[no_mangle] pub static SIGPOLL: usize = 29;
-#[no_mangle] pub static SIGPWR: usize = 30;
-#[no_mangle] pub static SIGSYS: usize = 31;
-#[no_mangle] pub static SIGUNUSED: usize = 31;
+pub const SIGHUP: usize = 1;
+pub const SIGINT: usize = 2;
+pub const SIGQUIT: usize = 3;
+pub const SIGILL: usize = 4;
+pub const SIGTRAP: usize = 5;
+pub const SIGABRT: usize = 6;
+pub const SIGIOT: usize = SIGABRT;
+pub const SIGBUS: usize = 7;
+pub const SIGFPE: usize = 8;
+pub const SIGKILL: usize = 9;
+pub const SIGUSR1: usize = 10;
+pub const SIGSEGV: usize = 11;
+pub const SIGUSR2: usize = 12;
+pub const SIGPIPE: usize = 13;
+pub const SIGALRM: usize = 14;
+pub const SIGTERM: usize = 15;
+pub const SIGSTKFLT: usize = 16;
+pub const SIGCHLD: usize = 17;
+pub const SIGCONT: usize = 18;
+pub const SIGSTOP: usize = 19;
+pub const SIGTSTP: usize = 20;
+pub const SIGTTIN: usize = 21;
+pub const SIGTTOU: usize = 22;
+pub const SIGURG: usize = 23;
+pub const SIGXCPU: usize = 24;
+pub const SIGXFSZ: usize = 25;
+pub const SIGVTALRM: usize = 26;
+pub const SIGPROF: usize = 27;
+pub const SIGWINCH: usize = 28;
+pub const SIGIO: usize = 29;
+pub const SIGPOLL: usize = 29;
+pub const SIGPWR: usize = 30;
+pub const SIGSYS: usize = 31;
+pub const SIGUNUSED: usize = SIGSYS;
 
-#[no_mangle] pub static SA_NOCLDSTOP: usize = 1;
-#[no_mangle] pub static SA_NOCLDWAIT: usize = 2;
-#[no_mangle] pub static SA_SIGINFO: usize = 4;
-#[no_mangle] pub static SA_ONSTACK: usize = 0x08000000;
-#[no_mangle] pub static SA_RESTART: usize = 0x10000000;
-#[no_mangle] pub static SA_NODEFER: usize = 0x40000000;
-#[no_mangle] pub static SA_RESETHAND: usize = 0x80000000;
-#[no_mangle] pub static SA_RESTORER: usize = 0x04000000;
+pub const SA_NOCLDSTOP: usize = 1;
+pub const SA_NOCLDWAIT: usize = 2;
+pub const SA_SIGINFO: usize = 4;
+pub const SA_ONSTACK: usize = 0x08000000;
+pub const SA_RESTART: usize = 0x10000000;
+pub const SA_NODEFER: usize = 0x40000000;
+pub const SA_RESETHAND: usize = 0x80000000;
+pub const SA_RESTORER: usize = 0x04000000;
diff --git a/src/signal/src/redox.rs b/src/signal/src/redox.rs
index 6abede5f..b5108b5a 100644
--- a/src/signal/src/redox.rs
+++ b/src/signal/src/redox.rs
@@ -3,42 +3,42 @@ pub struct sys_sigset_t {
     pub bits: [u64; 2],
 }
 
-#[no_mangle] pub static SIGHUP: usize = 1;
-#[no_mangle] pub static SIGINT: usize = 2;
-#[no_mangle] pub static SIGQUIT: usize = 3;
-#[no_mangle] pub static SIGILL: usize = 4;
-#[no_mangle] pub static SIGTRAP: usize = 5;
-#[no_mangle] pub static SIGBUS: usize = 7;
-#[no_mangle] pub static SIGFPE: usize = 8;
-#[no_mangle] pub static SIGKILL: usize = 9;
-#[no_mangle] pub static SIGUSR1: usize = 10;
-#[no_mangle] pub static SIGSEGV: usize = 11;
-#[no_mangle] pub static SIGUSR2: usize = 12;
-#[no_mangle] pub static SIGPIPE: usize = 13;
-#[no_mangle] pub static SIGALRM: usize = 14;
-#[no_mangle] pub static SIGTERM: usize = 15;
-#[no_mangle] pub static SIGSTKFLT: usize = 16;
-#[no_mangle] pub static SIGCHLD: usize = 17;
-#[no_mangle] pub static SIGCONT: usize = 18;
-#[no_mangle] pub static SIGSTOP: usize = 19;
-#[no_mangle] pub static SIGTSTP: usize = 20;
-#[no_mangle] pub static SIGTTIN: usize = 21;
-#[no_mangle] pub static SIGTTOU: usize = 22;
-#[no_mangle] pub static SIGURG: usize = 23;
-#[no_mangle] pub static SIGXCPU: usize = 24;
-#[no_mangle] pub static SIGXFSZ: usize = 25;
-#[no_mangle] pub static SIGVTALRM: usize = 26;
-#[no_mangle] pub static SIGPROF: usize = 27;
-#[no_mangle] pub static SIGWINCH: usize = 28;
-#[no_mangle] pub static SIGIO: usize = 29;
-#[no_mangle] pub static SIGPWR: usize = 30;
-#[no_mangle] pub static SIGSYS: usize = 31;
+pub const SIGHUP: usize = 1;
+pub const SIGINT: usize = 2;
+pub const SIGQUIT: usize = 3;
+pub const SIGILL: usize = 4;
+pub const SIGTRAP: usize = 5;
+pub const SIGBUS: usize = 7;
+pub const SIGFPE: usize = 8;
+pub const SIGKILL: usize = 9;
+pub const SIGUSR1: usize = 10;
+pub const SIGSEGV: usize = 11;
+pub const SIGUSR2: usize = 12;
+pub const SIGPIPE: usize = 13;
+pub const SIGALRM: usize = 14;
+pub const SIGTERM: usize = 15;
+pub const SIGSTKFLT: usize = 16;
+pub const SIGCHLD: usize = 17;
+pub const SIGCONT: usize = 18;
+pub const SIGSTOP: usize = 19;
+pub const SIGTSTP: usize = 20;
+pub const SIGTTIN: usize = 21;
+pub const SIGTTOU: usize = 22;
+pub const SIGURG: usize = 23;
+pub const SIGXCPU: usize = 24;
+pub const SIGXFSZ: usize = 25;
+pub const SIGVTALRM: usize = 26;
+pub const SIGPROF: usize = 27;
+pub const SIGWINCH: usize = 28;
+pub const SIGIO: usize = 29;
+pub const SIGPWR: usize = 30;
+pub const SIGSYS: usize = 31;
 
-#[no_mangle] pub static SA_NOCLDSTOP: usize = 0x00000001;
-#[no_mangle] pub static SA_NOCLDWAIT: usize = 0x00000002;
-#[no_mangle] pub static SA_SIGINFO: usize = 0x00000004;
-#[no_mangle] pub static SA_RESTORER: usize = 0x04000000;
-#[no_mangle] pub static SA_ONSTACK: usize = 0x08000000;
-#[no_mangle] pub static SA_RESTART: usize = 0x10000000;
-#[no_mangle] pub static SA_NODEFER: usize = 0x40000000;
-#[no_mangle] pub static SA_RESETHAND: usize = 0x80000000;
+pub const SA_NOCLDSTOP: usize = 0x00000001;
+pub const SA_NOCLDWAIT: usize = 0x00000002;
+pub const SA_SIGINFO: usize = 0x00000004;
+pub const SA_RESTORER: usize = 0x04000000;
+pub const SA_ONSTACK: usize = 0x08000000;
+pub const SA_RESTART: usize = 0x10000000;
+pub const SA_NODEFER: usize = 0x40000000;
+pub const SA_RESETHAND: usize = 0x80000000;
-- 
GitLab