commit: 9727c7ea9d4793d721b0fc1a473dd739df16cb3b
parent: 9310d68366c711386e8ae64e10a2bf83f6aae7c0
author: Brian Callahan <bcallah@openbsd.org>
date: Sun, 17 Sep 2017 18:00:15 -0400
Make this build on Linux proper. Silence some warnings.
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/emacs.c b/emacs.c
@@ -14,7 +14,11 @@
#include "config.h"
#ifdef EMACS
+#ifdef __linux__
+#include "portable/linux/queue.h"
+#else
#include <sys/queue.h>
+#endif
#include <sys/stat.h>
#include <ctype.h>
diff --git a/portable/linux/linux.h b/portable/linux/linux.h
@@ -5,6 +5,7 @@
/* Includes */
#include <sys/file.h>
#include <sys/param.h>
+#include <stdint.h>
#include <stdlib.h>
#include <time.h>
@@ -12,6 +13,7 @@
#define _PW_NAME_LEN LOGIN_NAME_MAX
#define O_EXLOCK 0
#define srand_deterministic(x) srand(x)
+#define sys_signame esys_signame
#ifndef __CYGWIN__
#define CHILD_MAX 80
@@ -46,7 +48,6 @@
#endif
/* Functions */
-const char *const sys_signame;
mode_t getmode(const void *, mode_t);
void *reallocarray(void *, size_t, size_t);
void *setmode(const char *);
@@ -54,3 +55,6 @@ size_t strlcat(char *, const char *, size_t);
size_t strlcpy(char *, const char *, size_t);
long long strtonum(const char *numstr, long long minval, long long maxval,
const char **errstrp);
+
+/* Externs */
+extern const char *const sys_signame[NSIG];
diff --git a/portable/linux/signame.c b/portable/linux/signame.c
@@ -31,6 +31,8 @@
#include <signal.h>
#include <unistd.h>
+#include "linux.h"
+
const char *const sys_signame[NSIG] = {
"Signal 0",
"HUP", /* SIGHUP */
diff --git a/portable/linux/vis.h b/portable/linux/vis.h
@@ -79,14 +79,11 @@ __BEGIN_DECLS
char *vis(char *, int, int, int);
int strvis(char *, const char *, int);
int stravis(char **, const char *, int);
-int strnvis(char *, const char *, size_t, int)
- __attribute__ ((__bounded__(__string__,1,3)));
-int strvisx(char *, const char *, size_t, int)
- __attribute__ ((__bounded__(__string__,1,3)));
+int strnvis(char *, const char *, size_t, int);
+int strvisx(char *, const char *, size_t, int);
int strunvis(char *, const char *);
int unvis(char *, char, int *, int);
-ssize_t strnunvis(char *, const char *, size_t)
- __attribute__ ((__bounded__(__string__,1,3)));
+ssize_t strnunvis(char *, const char *, size_t);
__END_DECLS