From: Jim Warner Date: Sat, 25 Jul 2020 05:00:00 +0000 (-0500) Subject: library: ensure 'XTRA_PROCPS_DEBUG' works in real life X-Git-Tag: v4.0.0~326 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dbe34f631270bd1ee026b1413e7ef428a9b8c74e;p=procps-ng library: ensure 'XTRA_PROCPS_DEBUG' works in real life This commit attempts to smooth some wrinkles impacting any future libprocps user exploitation. The 2 problems relate exclusively to our XTRA_PROCPS_DEBUG provision. 1. The 'xtra-procps-debug.h' header had an include for 'procps-private.h', which was not an installed header. So the STRINGIFY macros will now be embedded directly. 2. Each of the new api headers referenced '' rather than '' for the debugging #include. So, we must drop that prefix in favor of a quoted file name so that debugging builds work regardless of where that 'xtra-procps-debug.h' header happens to be found. Reference(s): . Jun, 2020 - changed target install directory commit d64755ea5f48295f5b064da0ea667ee3503b4cd8 . Sep, 2018 - #include migrated from procps.h commit fab37662efe92650063a45e6b20eda09afe07e14 Signed-off-by: Jim Warner --- diff --git a/proc/diskstats.h b/proc/diskstats.h index bc14c5d9..2886b1fa 100644 --- a/proc/diskstats.h +++ b/proc/diskstats.h @@ -129,7 +129,7 @@ struct diskstats_stack **procps_diskstats_sort ( #ifdef XTRA_PROCPS_DEBUG -# include +# include "xtra-procps-debug.h" #endif #ifdef __cplusplus } diff --git a/proc/meminfo.h b/proc/meminfo.h index e7fffd58..944f780f 100644 --- a/proc/meminfo.h +++ b/proc/meminfo.h @@ -201,7 +201,7 @@ struct meminfo_stack *procps_meminfo_select ( #ifdef XTRA_PROCPS_DEBUG -# include +# include "xtra-procps-debug.h" #endif #ifdef __cplusplus } diff --git a/proc/pids.h b/proc/pids.h index d7047f82..2561dfc0 100644 --- a/proc/pids.h +++ b/proc/pids.h @@ -239,7 +239,7 @@ struct pids_stack **procps_pids_sort ( #ifdef XTRA_PROCPS_DEBUG -# include +# include "xtra-procps-debug.h" #endif #ifdef __cplusplus } diff --git a/proc/slabinfo.h b/proc/slabinfo.h index 9b0c587d..1899c868 100644 --- a/proc/slabinfo.h +++ b/proc/slabinfo.h @@ -133,7 +133,7 @@ struct slabinfo_stack **procps_slabinfo_sort ( #ifdef XTRA_PROCPS_DEBUG -# include +# include "xtra-procps-debug.h" #endif #ifdef __cplusplus } diff --git a/proc/stat.h b/proc/stat.h index b4f19b21..d4c75534 100644 --- a/proc/stat.h +++ b/proc/stat.h @@ -162,7 +162,7 @@ struct stat_stack **procps_stat_sort ( #ifdef XTRA_PROCPS_DEBUG -# include +# include "xtra-procps-debug.h" #endif #ifdef __cplusplus } diff --git a/proc/vmstat.h b/proc/vmstat.h index f29db353..b75a39f4 100644 --- a/proc/vmstat.h +++ b/proc/vmstat.h @@ -353,7 +353,7 @@ struct vmstat_stack *procps_vmstat_select ( #ifdef XTRA_PROCPS_DEBUG -# include +# include "xtra-procps-debug.h" #endif #ifdef __cplusplus } diff --git a/proc/xtra-procps-debug.h b/proc/xtra-procps-debug.h index 15746f04..fa446540 100644 --- a/proc/xtra-procps-debug.h +++ b/proc/xtra-procps-debug.h @@ -18,7 +18,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#define STRINGIFY_ARG(a) #a +#define STRINGIFY(a) STRINGIFY_ARG(a) // --- DISKSTATS ------------------------------------------