diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog index c7163f4a55e806619e2052e2f998760f4a43d414..0570b6f30df8c46419482338888808bd05790a09 100644 --- a/smartmontools/ChangeLog +++ b/smartmontools/ChangeLog @@ -2,6 +2,8 @@ $Id$ 2018-08-04 Christian Franke <franke@computer.org> + Remove int64.h, use <inttypes.h> or <stdint.h> instead. + configure.ac, utility.cpp, utility.h: Add 128-bit unsigned integer to string conversion. Provides full integer precision if compiler supports '__int128' (e.g. x86_64 GCC and CLang). diff --git a/smartmontools/Makefile.am b/smartmontools/Makefile.am index a0c54f4bb0f00cd4806f43357a1cfd5836cfe020..28a304dc6738c84ceee763adce8f94418ee1fc1e 100644 --- a/smartmontools/Makefile.am +++ b/smartmontools/Makefile.am @@ -69,7 +69,6 @@ smartctl_SOURCES = \ dev_interface.h \ dev_tunnelled.h \ drivedb.h \ - int64.h \ json.cpp \ json.h \ knowndrives.cpp \ @@ -142,7 +141,6 @@ smartd_SOURCES = \ dev_interface.h \ dev_tunnelled.h \ drivedb.h \ - int64.h \ knowndrives.cpp \ knowndrives.h \ nvmecmds.cpp \ diff --git a/smartmontools/atacmds.cpp b/smartmontools/atacmds.cpp index b2e3a3d1e52af389dcd6179a06291d277e51dad9..b85fb309c57c96b6765578962be13eee394f3ccc 100644 --- a/smartmontools/atacmds.cpp +++ b/smartmontools/atacmds.cpp @@ -4,7 +4,7 @@ * Home page of code is: http://www.smartmontools.org * * Copyright (C) 2002-11 Bruce Allen - * Copyright (C) 2008-17 Christian Franke + * Copyright (C) 2008-18 Christian Franke * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org> * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> * @@ -23,14 +23,16 @@ * */ +#include "config.h" +#define __STDC_FORMAT_MACROS 1 // enable PRI* for C++ + +#include <inttypes.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> #include <ctype.h> -#include "config.h" -#include "int64.h" #include "atacmds.h" #include "knowndrives.h" // get_default_attr_defs() #include "utility.h" diff --git a/smartmontools/ataidentify.cpp b/smartmontools/ataidentify.cpp index cd7e281e3aebacde185b716fd2536f478494d001..bd94a89c6626b2d31b24ad71418fc28eec5798b1 100644 --- a/smartmontools/ataidentify.cpp +++ b/smartmontools/ataidentify.cpp @@ -3,7 +3,7 @@ * * Home page of code is: http://www.smartmontools.org * - * Copyright (C) 2012-17 Christian Franke + * Copyright (C) 2012-18 Christian Franke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,14 +16,16 @@ */ #include "config.h" +#define __STDC_FORMAT_MACROS 1 // enable PRI* for C++ + #include "ataidentify.h" const char * ataidentify_cpp_cvsid = "$Id$" ATAIDENTIFY_H_CVSID; -#include "int64.h" #include "utility.h" +#include <inttypes.h> // Table 12 of X3T10/0948D (ATA-2) Revision 4c, March 18, 1996 // Table 9 of X3T13/2008D (ATA-3) Revision 7b, January 27, 1997 diff --git a/smartmontools/ataprint.cpp b/smartmontools/ataprint.cpp index f0eee82e23c813dfde1a4e0bae443e5184d64575..8a11c29c73ecd1d5380e908ff8580ff082c88c38 100644 --- a/smartmontools/ataprint.cpp +++ b/smartmontools/ataprint.cpp @@ -23,14 +23,15 @@ */ #include "config.h" +#define __STDC_FORMAT_MACROS 1 // enable PRI* for C++ #include <ctype.h> #include <errno.h> +#include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "int64.h" #include "atacmdnames.h" #include "atacmds.h" #include "ataidentify.h" diff --git a/smartmontools/cciss.cpp b/smartmontools/cciss.cpp index 996a04edb947569fb0076d2da715b0da2e3f9096..ce415af1aaaec82dc29c6fdb3c9b47c2e32c9146 100644 --- a/smartmontools/cciss.cpp +++ b/smartmontools/cciss.cpp @@ -34,7 +34,6 @@ #ifdef _HAVE_CCISS #include "cciss.h" -#include "int64.h" #include "scsicmds.h" #include "utility.h" diff --git a/smartmontools/dev_areca.cpp b/smartmontools/dev_areca.cpp index 545c19413a7982a6cdc369554822271843460859..aa5fbdc39288490eb59d64ec8fd7db22381b5a52 100644 --- a/smartmontools/dev_areca.cpp +++ b/smartmontools/dev_areca.cpp @@ -16,7 +16,6 @@ */ #include "config.h" -#include "int64.h" #include "dev_interface.h" #include "dev_areca.h" diff --git a/smartmontools/dev_ata_cmd_set.cpp b/smartmontools/dev_ata_cmd_set.cpp index 6c2f6d708db14b7fe15cb1471476da138593ef6d..f92e4db3d7dbf9cb2476a8b7c71644a79360ab66 100644 --- a/smartmontools/dev_ata_cmd_set.cpp +++ b/smartmontools/dev_ata_cmd_set.cpp @@ -3,7 +3,7 @@ * * Home page of code is: http://www.smartmontools.org * - * Copyright (C) 2008 Christian Franke + * Copyright (C) 2008-18 Christian Franke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ */ #include "config.h" -#include "int64.h" + #include "atacmds.h" #include "dev_ata_cmd_set.h" diff --git a/smartmontools/dev_intelliprop.cpp b/smartmontools/dev_intelliprop.cpp index ffc8fc54a80791747b7f9da1558b7849a8752ee6..aaf83315c7cb501e7b80226568ce9ee1cd607a6c 100644 --- a/smartmontools/dev_intelliprop.cpp +++ b/smartmontools/dev_intelliprop.cpp @@ -16,7 +16,7 @@ */ #include "config.h" -#include "int64.h" + #include "atacmds.h" //ATTR_PACKED and ASSERT_SIZEOF_STRUCT #include "dev_interface.h" #include "dev_intelliprop.h" diff --git a/smartmontools/dev_interface.cpp b/smartmontools/dev_interface.cpp index 791e211385df732782f82a0a738ed72ae09b40ec..1224ffb5e29ae59bd1d375838989eb10f2c8e2c0 100644 --- a/smartmontools/dev_interface.cpp +++ b/smartmontools/dev_interface.cpp @@ -16,7 +16,7 @@ */ #include "config.h" -#include "int64.h" + #include "dev_interface.h" #include "dev_intelliprop.h" #include "dev_tunnelled.h" diff --git a/smartmontools/dev_legacy.cpp b/smartmontools/dev_legacy.cpp index a6e25c8c8a5ef1fdfee8cae0d6130564102515aa..9dc418c15a4ca2a2df3b28bd026b64abd2373ede 100644 --- a/smartmontools/dev_legacy.cpp +++ b/smartmontools/dev_legacy.cpp @@ -3,7 +3,7 @@ * * Home page of code is: http://www.smartmontools.org * - * Copyright (C) 2008-16 Christian Franke + * Copyright (C) 2008-18 Christian Franke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ */ #include "config.h" -#include "int64.h" + #include "utility.h" #include "atacmds.h" #include "scsicmds.h" diff --git a/smartmontools/int64.h b/smartmontools/int64.h deleted file mode 100644 index 09840a60d15fbd051621844222c5d2ff998588ee..0000000000000000000000000000000000000000 --- a/smartmontools/int64.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * int64.h - * - * Home page of code is: http://www.smartmontools.org - * - * Copyright (C) 2002-11 Bruce Allen - * Copyright (C) 2004-18 Christian Franke - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * You should have received a copy of the GNU General Public License - * (for example COPYING); if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#ifndef INT64_H_ -#define INT64_H_ - -#define INT64_H_CVSID "$Id$" - -// TODO: Remove this file, use <inttypes.h> or <stdint.h> instead. - -// The ISO C99 standard specifies that in C++ implementations the PRI* macros -// from <inttypes.h> should only be defined if explicitly requested -#define __STDC_FORMAT_MACROS 1 -#include <inttypes.h> // PRId64, PRIu64, PRIx64 (also includes <stdint.h>) - -#endif // INT64_H diff --git a/smartmontools/knowndrives.cpp b/smartmontools/knowndrives.cpp index 12b182fdaa08db8cb8bf16d88d753f66ad724a61..7eaa7fc1346232ad0df66081a4eadd0d3e352677 100644 --- a/smartmontools/knowndrives.cpp +++ b/smartmontools/knowndrives.cpp @@ -4,7 +4,7 @@ * Home page of code is: http://www.smartmontools.org * * Copyright (C) 2003-11 Philip Williams, Bruce Allen - * Copyright (C) 2008-16 Christian Franke + * Copyright (C) 2008-18 Christian Franke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ */ #include "config.h" -#include "int64.h" + #include <stdio.h> #include "atacmds.h" #include "knowndrives.h" diff --git a/smartmontools/nvmecmds.h b/smartmontools/nvmecmds.h index 348e5fb0f21394765e6bf59c4ea8c9d7f0e4395d..a8dd4172d6370d6320e5620c8f5ee32e060cd03b 100644 --- a/smartmontools/nvmecmds.h +++ b/smartmontools/nvmecmds.h @@ -3,7 +3,7 @@ * * Home page of code is: http://www.smartmontools.org * - * Copyright (C) 2016 Christian Franke + * Copyright (C) 2016-18 Christian Franke * * Original code from <linux/nvme.h>: * Copyright (C) 2011-2014 Intel Corporation @@ -23,7 +23,7 @@ #define NVMECMDS_H_CVSID "$Id$" -#include "int64.h" +#include <stdint.h> // The code below was orginally imported from <linux/nvme.h> include file from // Linux kernel sources. Types from <linux/types.h> were replaced. diff --git a/smartmontools/nvmeprint.cpp b/smartmontools/nvmeprint.cpp index d5910f5dd122321ac66082cad3fba2d06a992625..d85bfd9f90c73bc80e0f9b947f4bf92dcef41ffa 100644 --- a/smartmontools/nvmeprint.cpp +++ b/smartmontools/nvmeprint.cpp @@ -16,12 +16,13 @@ */ #include "config.h" +#define __STDC_FORMAT_MACROS 1 // enable PRI* for C++ + #include "nvmeprint.h" const char * nvmeprint_cvsid = "$Id$" NVMEPRINT_H_CVSID; -#include "int64.h" #include "utility.h" #include "dev_interface.h" #include "nvmecmds.h" @@ -30,6 +31,8 @@ const char * nvmeprint_cvsid = "$Id$" #include "smartctl.h" #include "sg_unaligned.h" +#include <inttypes.h> + using namespace smartmontools; // Return true if 128 bit LE integer is != 0. diff --git a/smartmontools/os_darwin.cpp b/smartmontools/os_darwin.cpp index e7d40837c324a8b3d50fea8c73761e8c374abcb7..a4a1c6b73ea98f49ff1aef3ed83674879945ab9e 100644 --- a/smartmontools/os_darwin.cpp +++ b/smartmontools/os_darwin.cpp @@ -35,7 +35,7 @@ #include <CoreFoundation/CoreFoundation.h> #include "config.h" -#include "int64.h" + #include "atacmds.h" #include "scsicmds.h" #include "nvmecmds.h" diff --git a/smartmontools/os_freebsd.cpp b/smartmontools/os_freebsd.cpp index 5cfae66bbd821c231f4287448f26e3bd7cabdbdb..a6c9b90cf4729703db5d49be7b2acc63f5043c10 100644 --- a/smartmontools/os_freebsd.cpp +++ b/smartmontools/os_freebsd.cpp @@ -38,7 +38,7 @@ #include <sys/utsname.h> #include "config.h" -#include "int64.h" + // set by /usr/include/sys/ata.h, suppress warning #undef ATA_READ_LOG_EXT #include "atacmds.h" diff --git a/smartmontools/os_generic.cpp b/smartmontools/os_generic.cpp index 1546edcbd1f36a63f0000a1f4d500be8206ff58d..6cbb0334db275b1a85942ca45a57f96850d5b10c 100644 --- a/smartmontools/os_generic.cpp +++ b/smartmontools/os_generic.cpp @@ -5,7 +5,7 @@ * * Copyright (C) YEAR YOUR_NAME * Copyright (C) 2003-8 Bruce Allen - * Copyright (C) 2008 Christian Franke + * Copyright (C) 2008-18 Christian Franke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,7 +71,6 @@ // These are needed to define prototypes and structures for the // functions defined below -#include "int64.h" #include "atacmds.h" #include "utility.h" diff --git a/smartmontools/os_linux.cpp b/smartmontools/os_linux.cpp index e305a37289f6c7674a50669ce25866e934acd9a2..219351efb23a720f2d66e9b10d44320fc15795be 100644 --- a/smartmontools/os_linux.cpp +++ b/smartmontools/os_linux.cpp @@ -84,7 +84,6 @@ #include <selinux/selinux.h> #endif -#include "int64.h" #include "atacmds.h" #include "os_linux.h" #include "scsicmds.h" diff --git a/smartmontools/os_netbsd.cpp b/smartmontools/os_netbsd.cpp index 7f06d9c7f3dfa58568e975e7e2548f235358e1c9..65ff23cb962c815c2ffd52533fa37d97ba321f67 100644 --- a/smartmontools/os_netbsd.cpp +++ b/smartmontools/os_netbsd.cpp @@ -18,7 +18,7 @@ */ #include "config.h" -#include "int64.h" + #include "atacmds.h" #include "scsicmds.h" #include "utility.h" diff --git a/smartmontools/os_openbsd.cpp b/smartmontools/os_openbsd.cpp index d3fed84425c7d0850a3a9665be433ecc45ae1477..97ee2a41031b515b5cae582c236c8bd5488790bf 100644 --- a/smartmontools/os_openbsd.cpp +++ b/smartmontools/os_openbsd.cpp @@ -19,7 +19,7 @@ */ #include "config.h" -#include "int64.h" + #include "atacmds.h" #include "scsicmds.h" #include "utility.h" diff --git a/smartmontools/os_os2.cpp b/smartmontools/os_os2.cpp index 65860efb00f45d969edd7d40c39fe82b5effa7d1..858926563852cc5bd73359ee8316e4ace2e5eacb 100644 --- a/smartmontools/os_os2.cpp +++ b/smartmontools/os_os2.cpp @@ -23,7 +23,6 @@ // These are needed to define prototypes for the functions defined below #include "config.h" -#include "int64.h" #include <ctype.h> #include <errno.h> diff --git a/smartmontools/os_qnxnto.cpp b/smartmontools/os_qnxnto.cpp index 44bf5c37b7d569ac9c844fc848c5a71a591322fe..95678e3c132a148e33e70216015111a59f23c9a3 100644 --- a/smartmontools/os_qnxnto.cpp +++ b/smartmontools/os_qnxnto.cpp @@ -5,7 +5,6 @@ // These are needed to define prototypes and structures for the // functions defined below -#include "int64.h" #include "atacmds.h" #include "scsicmds.h" #include "utility.h" diff --git a/smartmontools/os_solaris.cpp b/smartmontools/os_solaris.cpp index fef639721aa6a8744786cc628fc49b09cf0343bd..31029bdae0f4ccac71f744e7e41b3599a7b596ca 100644 --- a/smartmontools/os_solaris.cpp +++ b/smartmontools/os_solaris.cpp @@ -27,7 +27,7 @@ // These are needed to define prototypes for the functions defined below #include "config.h" -#include "int64.h" + #include "atacmds.h" #include "scsicmds.h" #include "utility.h" diff --git a/smartmontools/os_win32.cpp b/smartmontools/os_win32.cpp index de70b78c488872d87f3b81d196aa7d9b5d8bd4a5..7b3196c55c6fc3e06793744abb083ea7cd3e729f 100644 --- a/smartmontools/os_win32.cpp +++ b/smartmontools/os_win32.cpp @@ -25,7 +25,6 @@ #define WINVER 0x0502 #define _WIN32_WINNT WINVER -#include "int64.h" #include "atacmds.h" #include "scsicmds.h" #include "nvmecmds.h" diff --git a/smartmontools/os_win32/vc14/smartctl.vcxproj b/smartmontools/os_win32/vc14/smartctl.vcxproj index 767a51415a2e9c28fb7598c69718946638ed473f..b90194316963f85fa745b0b1286db013aaf87b13 100644 --- a/smartmontools/os_win32/vc14/smartctl.vcxproj +++ b/smartmontools/os_win32/vc14/smartctl.vcxproj @@ -326,7 +326,6 @@ <ClInclude Include="..\..\dev_interface.h" /> <ClInclude Include="..\..\dev_tunnelled.h" /> <ClInclude Include="..\..\drivedb.h" /> - <ClInclude Include="..\..\int64.h" /> <ClInclude Include="..\..\knowndrives.h" /> <CustomBuildStep Include="..\..\megaraid.h"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> diff --git a/smartmontools/os_win32/vc14/smartctl.vcxproj.filters b/smartmontools/os_win32/vc14/smartctl.vcxproj.filters index a790ae63bb7caffb7299f5d26cc7971214f2e96e..cc4b1a4c3bb25a36946b5569e779bc30d8210db5 100644 --- a/smartmontools/os_win32/vc14/smartctl.vcxproj.filters +++ b/smartmontools/os_win32/vc14/smartctl.vcxproj.filters @@ -96,7 +96,6 @@ <ClInclude Include="..\..\dev_interface.h" /> <ClInclude Include="..\..\dev_tunnelled.h" /> <ClInclude Include="..\..\drivedb.h" /> - <ClInclude Include="..\..\int64.h" /> <ClInclude Include="..\..\knowndrives.h" /> <ClInclude Include="..\..\scsicmds.h" /> <ClInclude Include="..\..\scsiprint.h" /> diff --git a/smartmontools/os_win32/vc14/smartd.vcxproj b/smartmontools/os_win32/vc14/smartd.vcxproj index e68a50b74f423a1d6dc42d25e734f754c87538ae..3210f4c67f8bee5f1ca932fb02c37db4f598bf13 100644 --- a/smartmontools/os_win32/vc14/smartd.vcxproj +++ b/smartmontools/os_win32/vc14/smartd.vcxproj @@ -339,7 +339,6 @@ <ClInclude Include="..\..\dev_interface.h" /> <ClInclude Include="..\..\dev_tunnelled.h" /> <ClInclude Include="..\..\drivedb.h" /> - <ClInclude Include="..\..\int64.h" /> <ClInclude Include="..\..\knowndrives.h" /> <CustomBuildStep Include="..\..\megaraid.h"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> diff --git a/smartmontools/os_win32/vc14/smartd.vcxproj.filters b/smartmontools/os_win32/vc14/smartd.vcxproj.filters index 8dbe158edb1aef09e6eb206632e7a1feb2c5959b..bca6b0d1ed7d1f1f0fff9742284a14ba1d943800 100644 --- a/smartmontools/os_win32/vc14/smartd.vcxproj.filters +++ b/smartmontools/os_win32/vc14/smartd.vcxproj.filters @@ -100,7 +100,6 @@ <ClInclude Include="..\..\dev_interface.h" /> <ClInclude Include="..\..\dev_tunnelled.h" /> <ClInclude Include="..\..\drivedb.h" /> - <ClInclude Include="..\..\int64.h" /> <ClInclude Include="..\..\knowndrives.h" /> <ClInclude Include="..\..\scsicmds.h" /> <ClInclude Include="..\..\utility.h" /> diff --git a/smartmontools/scsiata.cpp b/smartmontools/scsiata.cpp index d21af7d9b22a9d2292f9d8382e45a0fe6b243e8c..f4afda90c78eccfb2305d8f8e3c548432e9183f4 100644 --- a/smartmontools/scsiata.cpp +++ b/smartmontools/scsiata.cpp @@ -53,7 +53,7 @@ #include <errno.h> #include "config.h" -#include "int64.h" + #include "scsicmds.h" #include "atacmds.h" // ataReadHDIdentity() #include "knowndrives.h" // lookup_usb_device() diff --git a/smartmontools/scsicmds.cpp b/smartmontools/scsicmds.cpp index aea540ac9502d7561e34f595ab90b690e60ed4ee..c0a097d2f4370ac3259dba71d3eb2f86944fc37b 100644 --- a/smartmontools/scsicmds.cpp +++ b/smartmontools/scsicmds.cpp @@ -41,7 +41,7 @@ #include <ctype.h> #include "config.h" -#include "int64.h" + #include "scsicmds.h" #include "atacmds.h" // FIXME: for smart_command_set only #include "dev_interface.h" diff --git a/smartmontools/scsiprint.cpp b/smartmontools/scsiprint.cpp index d4972f24936541cdaf48b6a660e199866cdffdad..2f3cc8186d2f419ad2268cc2ccd409c6d36e03ee 100644 --- a/smartmontools/scsiprint.cpp +++ b/smartmontools/scsiprint.cpp @@ -24,13 +24,15 @@ */ +#include "config.h" +#define __STDC_FORMAT_MACROS 1 // enable PRI* for C++ + +#include <inttypes.h> #include <stdio.h> #include <string.h> #include <fcntl.h> #include <errno.h> -#include "config.h" -#include "int64.h" #include "scsicmds.h" #include "atacmds.h" // smart_command_set #include "dev_interface.h" diff --git a/smartmontools/smartctl.cpp b/smartmontools/smartctl.cpp index d130dd4c89168631b9e356b41f747485bfd08361..3747ed7792e107fad49b569636ff98dccfe50b45 100644 --- a/smartmontools/smartctl.cpp +++ b/smartmontools/smartctl.cpp @@ -4,7 +4,7 @@ * Home page of code is: http://www.smartmontools.org * * Copyright (C) 2002-11 Bruce Allen - * Copyright (C) 2008-17 Christian Franke + * Copyright (C) 2008-18 Christian Franke * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org> * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,11 @@ * */ +#include "config.h" +#define __STDC_FORMAT_MACROS 1 // enable PRI* for C++ + #include <errno.h> +#include <inttypes.h> #include <stdio.h> #include <sys/types.h> #include <string.h> @@ -31,8 +35,6 @@ #include <stdexcept> #include <getopt.h> -#include "config.h" - #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -41,7 +43,6 @@ #include <sys/param.h> #endif -#include "int64.h" #include "atacmds.h" #include "dev_interface.h" #include "ataprint.h" diff --git a/smartmontools/smartd.cpp b/smartmontools/smartd.cpp index df2746a4e1e1a4f8f9ecd2e9aea5e51543b3d71a..cd190d9b04efed5460169e7bc6c3093944a474b9 100644 --- a/smartmontools/smartd.cpp +++ b/smartmontools/smartd.cpp @@ -22,9 +22,10 @@ */ #include "config.h" -#include "int64.h" +#define __STDC_FORMAT_MACROS 1 // enable PRI* for C++ // unconditionally included files +#include <inttypes.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> // umask diff --git a/smartmontools/utility.cpp b/smartmontools/utility.cpp index 2d1de622fd883c9cd1bc4a0d3fbac5ce887bf4ab..4ce9cbc3d136acd32da76e577654a9d728198371 100644 --- a/smartmontools/utility.cpp +++ b/smartmontools/utility.cpp @@ -27,7 +27,9 @@ // SMARTCTL, OR BOTH. #include "config.h" +#define __STDC_FORMAT_MACROS 1 // enable PRI* for C++ +#include <inttypes.h> #include <stdio.h> #include <string.h> #include <time.h> @@ -46,7 +48,6 @@ #include <stdexcept> #include "svnversion.h" -#include "int64.h" #include "utility.h" #include "atacmds.h" @@ -54,7 +55,7 @@ #include "sg_unaligned.h" const char * utility_cpp_cvsid = "$Id$" - UTILITY_H_CVSID INT64_H_CVSID; + UTILITY_H_CVSID; const char * packet_types[] = { "Direct-access (disk)", diff --git a/smartmontools/utility.h b/smartmontools/utility.h index fc7d02a11f1638c3731c333aca5738a35cecffb8..7e3f991502cd9860be0a1f3b0a45e9a8134dca34 100644 --- a/smartmontools/utility.h +++ b/smartmontools/utility.h @@ -32,6 +32,7 @@ #include <sys/types.h> // for regex.h (according to POSIX) #include <regex.h> #include <stdarg.h> +#include <stdint.h> #include <stdio.h> #include <string.h> #include <string>