From a7b7ecc6776ffca8deec0a85dc661180d4b0e6cd Mon Sep 17 00:00:00 2001
From: ballen4705 <ballen4705@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Wed, 25 Oct 2006 17:01:42 +0000
Subject: [PATCH] Linux: compile fix for SuSE.  Check for existence of
 linux/compiler.h and include in os_linux.h if present.  Thanks to SB.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2307 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 sm5/CHANGELOG    | 6 +++++-
 sm5/configure.in | 6 ++++--
 sm5/os_linux.cpp | 9 +++++++--
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG
index b59801528..62dc43372 100644
--- a/sm5/CHANGELOG
+++ b/sm5/CHANGELOG
@@ -1,6 +1,6 @@
 CHANGELOG for smartmontools
 
-$Id: CHANGELOG,v 1.579 2006/10/25 06:52:06 ballen4705 Exp $
+$Id: CHANGELOG,v 1.580 2006/10/25 17:01:42 ballen4705 Exp $
 
 The most recent version of this file is:
 http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup
@@ -33,6 +33,10 @@ NOTES FOR FUTURE RELEASES: see TODO file.
 
 <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
 
+  [BA] Linux: compile fix for SuSE.  Check for existence
+       of linux/compiler.h and include in os_linux.h if
+       present.  Thanks to SB.
+
   [BA] smartd: DEVICESCAN will now pick up SATA/SAT devices
        attached to a SCSI device tree via SAT translation.
        Note: this is a bit of a hack.  I will document it once
diff --git a/sm5/configure.in b/sm5/configure.in
index 12684de1c..d3d6f6904 100644
--- a/sm5/configure.in
+++ b/sm5/configure.in
@@ -1,5 +1,5 @@
 #
-# $Id: configure.in,v 1.119 2006/10/22 11:50:47 ballen4705 Exp $
+# $Id: configure.in,v 1.120 2006/10/25 17:01:42 ballen4705 Exp $
 #
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.50)
@@ -7,7 +7,7 @@ AC_INIT(smartmontools, 5.37, smartmontools-support@lists.sourceforge.net)
 AC_CONFIG_SRCDIR(smartctl.cpp)
 
 smartmontools_configure_date=`date -u +"%Y/%m/%d %T %Z"`
-smartmontools_cvs_tag=`echo '$Id: configure.in,v 1.119 2006/10/22 11:50:47 ballen4705 Exp $'`
+smartmontools_cvs_tag=`echo '$Id: configure.in,v 1.120 2006/10/25 17:01:42 ballen4705 Exp $'`
 smartmontools_release_date=2006/04/12
 smartmontools_release_time="17:39:01 UTC"
 
@@ -59,6 +59,8 @@ AC_CHECK_HEADERS([sys/tweio.h])
 AC_CHECK_HEADERS([sys/twereg.h])
 dnl Check for FreeBSD twa include files...
 AC_CHECK_HEADERS([sys/tw_osl_ioctl.h])
+dnl This header file needed at least for SuSE LINUX
+AC_CHECK_HEADERS([linux/compiler.h])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_CHECK_TYPES([int64_t, uint64_t])
diff --git a/sm5/os_linux.cpp b/sm5/os_linux.cpp
index 54347ce5f..a541e3480 100644
--- a/sm5/os_linux.cpp
+++ b/sm5/os_linux.cpp
@@ -47,6 +47,11 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <glob.h>
+
+#ifdef HAVE_LINUX_COMPILER_H
+#include <linux/compiler.h>
+#endif
+
 #include <scsi/scsi_ioctl.h>
 #include <scsi/sg.h>
 #include <stdlib.h>
@@ -79,9 +84,9 @@ typedef unsigned long long u8;
 
 #define ARGUSED(x) ((void)(x))
 
-static const char *filenameandversion="$Id: os_linux.cpp,v 1.87 2006/10/09 11:45:12 guidog Exp $";
+static const char *filenameandversion="$Id: os_linux.cpp,v 1.88 2006/10/25 17:01:42 ballen4705 Exp $";
 
-const char *os_XXXX_c_cvsid="$Id: os_linux.cpp,v 1.87 2006/10/09 11:45:12 guidog Exp $" \
+const char *os_XXXX_c_cvsid="$Id: os_linux.cpp,v 1.88 2006/10/25 17:01:42 ballen4705 Exp $" \
 ATACMDS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_LINUX_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
 
 // to hold onto exit code for atexit routine
-- 
GitLab