fix compilation with glibc 2.26, major/minor functions, fixed #2

compilation error was:
  linux_sigar.c:1156:22: error: called object ‘major’ is not a function or function pointer
  linux_sigar.c:1157:22: error: called object ‘minor’ is not a function or function pointer
This commit is contained in:
Konstantin Makarchev 2018-06-10 07:43:26 +03:00
parent 2f7284cd4c
commit a2c67588d0
2 changed files with 7 additions and 0 deletions

View File

@ -49,6 +49,9 @@ when /mswin|mingw|cygwin|bccwin/
have_library("version")
when /linux/
os = 'linux'
if have_header("sys/sysmacros.h")
$CPPFLAGS += ' -DLINUX_SYSMACROS'
end
when /solaris|sun/
os = 'solaris'
have_library("nsl")

View File

@ -30,6 +30,10 @@
#include "sigar_util.h"
#include "sigar_os.h"
#ifdef LINUX_SYSMACROS // added by extconf.rb
#include <sys/sysmacros.h>
#endif
#define pageshift(x) ((x) << sigar->pagesize)
#define PROC_MEMINFO PROC_FS_ROOT "meminfo"