[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 19/48] bsd-user: style tweak: move extern to header file
From: |
imp |
Subject: |
[PATCH v2 19/48] bsd-user: style tweak: move extern to header file |
Date: |
Sat, 24 Apr 2021 09:59:47 -0600 |
From: Warner Losh <imp@bsdimp.com>
extern char **environ has no standard home, so move the declaration from the .c
file to a handy .h file. Since this is a standard, old-school UNIX interface
dating from the 5th edition, it's not quite the same issue that the rule is
supposed to protect against, though.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/main.c | 1 -
bsd-user/qemu.h | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 60a62e016a..1b5d815c3a 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -48,7 +48,6 @@ unsigned long reserved_va;
static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
const char *qemu_uname_release;
-extern char **environ;
enum BSDType bsd_type;
/*
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 7ccc8ad397..5a82722281 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -27,6 +27,8 @@
#include "exec/user/abitypes.h"
+extern char **environ;
+
enum BSDType {
target_freebsd,
target_netbsd,
--
2.22.1
- [PATCH v2 26/48] bsd-user: move sparc cpu_loop into target_arch_cpu.h as target_cpu_loop, (continued)
- [PATCH v2 26/48] bsd-user: move sparc cpu_loop into target_arch_cpu.h as target_cpu_loop, imp, 2021/04/24
- [PATCH v2 42/48] bsd-user: style tweak: spaces around operators and commas, imp, 2021/04/24
- [PATCH v2 38/48] bsd-user: style tweak: use {} for all if statements, format else correctly, imp, 2021/04/24
- [PATCH v2 44/48] bsd-user: style tweak: use preferred block comments, imp, 2021/04/24
- [PATCH v2 48/48] bsd-user: put back a break; that had gone missing..., imp, 2021/04/24
- [PATCH v2 19/48] bsd-user: style tweak: move extern to header file,
imp <=
- [PATCH v2 27/48] bsd-user: style tweak: space pedantry, imp, 2021/04/24
- [PATCH v2 35/48] bsd-user: style tweak: use {} for all if statements, format else correctly, imp, 2021/04/24
- [PATCH v2 30/48] bsd-user: style tweak: fix block comments, imp, 2021/04/24
- [PATCH v2 36/48] bsd-user: style tweak: Use preferred block comments, imp, 2021/04/24
- [PATCH v2 46/48] bsd-user: style tweak: Return is not a function call., imp, 2021/04/24