File add_AFS_STRINGIZE_macro.patch of Package openafs

From f5794e029903db79f345f42582230a1fd0f7d823 Mon Sep 17 00:00:00 2001
From: Andrew Deason <adeason@sinenomine.net>
Date: Mon, 5 Feb 2018 00:07:10 -0600
Subject: [PATCH] util: Add the AFS_STRINGIZE() macro

Add a macro to help with easily printing the value of #define'd
constants, called AFS_STRINGIZE(). For example:

    printf("The value of AFS_SYSCALL is: " AFS_STRINGIZE(AFS_SYSCALL) "\n");

Change-Id: I19a3e9d930f1ca2085506957b4e96dff5bf1c22e
Reviewed-on: https://gerrit.openafs.org/12893
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ian Wienand <iwienand@redhat.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
---
 src/util/afsutil.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/util/afsutil.h b/src/util/afsutil.h
index bd78946..bbebcc1 100644
--- a/src/util/afsutil.h
+++ b/src/util/afsutil.h
@@ -121,6 +121,11 @@ extern int re_exec(const char *p1);
 /* b64_string_t is 8 bytes, in stds.h */
      typedef char lb64_string_t[12];
 
+/* A simple macro to help show the value of #define'd constants. e.g. If 'FOO'
+ * is defined as 5, then AFS_STRINGIZE(FOO) expands to "5" */
+#define AFS_STRINGIZE_(s) #s
+#define AFS_STRINGIZE(s) AFS_STRINGIZE_(s)
+
 #include <afs/ktime.h>
 #include "afsutil_prototypes.h"
 
-- 
1.7.1

openSUSE Build Service is sponsored by