bwm-ng: fix build error with gcc7

patch some gcc7 issues with inline functions
This commit is contained in:
xeji 2018-02-24 00:56:02 +01:00
parent 831ef4756e
commit 2ad6f04da7

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, ncurses }:
{ writeText, stdenv, fetchurl, ncurses }:
let
version = "0.6.1";
@ -13,6 +13,32 @@ stdenv.mkDerivation rec {
buildInputs = [ ncurses ];
# gcc7 has some issues with inline functions
patches = [
(writeText "gcc7.patch"
''
--- a/src/bwm-ng.c
+++ b/src/bwm-ng.c
@@ -27,5 +27,5 @@
/* handle interrupt signal */
void sigint(int sig) FUNCATTR_NORETURN;
-inline void init(void);
+static inline void init(void);
/* clear stuff and exit */
--- a/src/options.c
+++ b/src/options.c
@@ -35,5 +35,5 @@
inline int str2output_type(char *optarg);
#endif
-inline int str2out_method(char *optarg);
+static inline int str2out_method(char *optarg);
inline int str2in_method(char *optarg);
'')
];
# This code uses inline in the gnu89 sense: see http://clang.llvm.org/compatibility.html#inline
NIX_CFLAGS_COMPILE = if stdenv.cc.isClang then "-std=gnu89" else null;