bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] [PATCH] Windows compilation error: #define concatenation in '


From: Jannick
Subject: [bug-gawk] [PATCH] Windows compilation error: #define concatenation in 'io.c'
Date: Sat, 2 Jan 2016 13:22:30 +0100

Hi,

 

My first post to this list, hope that everything is OK with it.

 

A tiny patch for your consideration avoiding a compilation error on Windows (concatenation in #define statement). The proposed solution might not be the most elegant way, but it works here.

 

Thanks,

J.

 

io.c | 6 +++++-

1 file changed, 5 insertions(+), 1 deletion(-)

 

diff --git a/io.c b/io.c

old mode 100644

new mode 100755

index 9385a1e..95d1322

--- a/io.c

+++ b/io.c

@@ -2813,7 +2813,9 @@ find_source(const char *src, struct stat *stb, int *errcode, int is_extlib)

                           size_t src_len;

                           size_t suffix_len;

-#define EXTLIB_SUFFIX "." SHLIBEXT

+#define PREPEND_DOT(x) VALUE_TO_STRING(.x)

+#define VALUE_TO_STRING(x) #x

+#define EXTLIB_SUFFIX             PREPEND_DOT(SHLIBEXT)

                           src_len = strlen(src);

                           suffix_len = strlen(EXTLIB_SUFFIX);

@@ -2831,6 +2833,8 @@ find_source(const char *src, struct stat *stb, int *errcode, int is_extlib)

                                         errno = save_errno;

                           return path;

#undef EXTLIB_SUFFIX

+#undef VALUE_TO_STRING

+#undef PREPEND_DOT

             }

 /*


reply via email to

[Prev in Thread] Current Thread [Next in Thread]