From 696bfc81aa6f2befe406b0e4e84c06467869320e Mon Sep 17 00:00:00 2001
From: Anders Lindh Olsson <anders.lindholsson@ess.eu>
Date: Wed, 20 Apr 2022 14:47:00 +0200
Subject: [PATCH] Improve cpp comments

---
 require-ess/src/require.c | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/require-ess/src/require.c b/require-ess/src/require.c
index ac5fc523..49200901 100644
--- a/require-ess/src/require.c
+++ b/require-ess/src/require.c
@@ -88,7 +88,7 @@ int requireDebug;
 #define PREFIX
 #define INFIX
 #define EXT ".dll"
-#else
+#else  // CYGWIN32
 #define PREFIX "lib"
 #define INFIX
 #define EXT ".so"
@@ -98,7 +98,7 @@ int requireDebug;
 
 #ifndef OS_CLASS
 #define OS_CLASS "WIN32"
-#endif
+#endif  // OS_CLASS
 
 #include <Psapi.h>
 #include <windows.h>
@@ -127,7 +127,7 @@ static char *realpath(const char *path, char *buffer) {
   return buffer;
 }
 
-#else
+#else  // defined(none)
 
 #warning unknown OS
 #define PREFIX
@@ -135,7 +135,7 @@ static char *realpath(const char *path, char *buffer) {
 #define EXT
 #define getAddress(module, name) NULL
 
-#endif
+#endif  // defined
 
 /* for readdir: Windows or Posix */
 #if defined(_WIN32)
@@ -156,7 +156,7 @@ static char *realpath(const char *path, char *buffer) {
     continue;
 #define FILENAME(e) e.cFileName
 
-#else
+#else  // defined(_WIN32)
 #include <dirent.h>
 #define DIR_HANDLE DIR *
 #define IF_OPEN_DIR(f) if ((dir = opendir(f)))
@@ -170,31 +170,29 @@ static char *realpath(const char *path, char *buffer) {
 #ifdef _DIRENT_HAVE_D_TYPE
 #define SKIP_NON_DIR(e) \
   if (e->d_type != DT_DIR && e->d_type != DT_UNKNOWN) continue;
-#else
+#else  // _DIRENT_HAVE_D_TYPE
 #define SKIP_NON_DIR(e)
-#endif
+#endif  // _DIRENT_HAVE_D_TYPE
 #define FILENAME(e) e->d_name
 
-#endif
+#endif  // defined(_WIN32)
 
 #define LIBDIR "lib" OSI_PATH_SEPARATOR
 #define TEMPLATEDIR "db"
 
-/*
-#define TOSTR(s) TOSTR2(s)
-#define TOSTR2(s) #s
-const char epicsRelease[] =
-TOSTR(EPICS_VERSION)"."TOSTR(EPICS_REVISION)"."TOSTR(EPICS_MODIFICATION);
+// #define TOSTR(s) TOSTR2(s)
+// #define TOSTR2(s) #s
+// const char epicsRelease[] =
+// TOSTR(EPICS_VERSION)"."TOSTR(EPICS_REVISION)"."TOSTR(EPICS_MODIFICATION);
 
-#ifndef T_A
-#error T_A not defined: Compile with USR_CFLAGS += -DT_A='"${T_A}"'
-#endif
-const char targetArch[] = T_A;
-      */
+// #ifndef T_A
+// #error T_A not defined: Compile with USR_CFLAGS += -DT_A='"${T_A}"'
+// #endif
+// const char targetArch[] = T_A;
 
 #ifndef OS_CLASS
 #error OS_CLASS not defined: Try to compile with USR_CFLAGS += -DOS_CLASS='"${OS_CLASS}"'
-#endif
+#endif  // OS_CLASS
 
 const char osClass[] = OS_CLASS;
 
-- 
GitLab