Hi all,

We got this bug report (https://github.com/bagder/curl/pull/76) about a name space pollution we have in the curl/curl.h public header. It was added by me in 47c392e135f17 (Jul 22 2009).

The fix that removes the pollution then also changes the name of an enum we provide. I suspect *very* few programs actually use the enum by name so it should be very rare that this breaks anything but still...

Any alternative suggestions?

NOTE: my fix is slightly different than the one in the pull request.

--

 / daniel.haxx.se
From 3cc9252a252e26ac3a2247fbf6332391e73aaf98 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <[email protected]>
Date: Wed, 21 Aug 2013 22:46:10 +0200
Subject: [PATCH] curl.h: name space pollution by "enum type"

Renamed to "enum curl_khtype" now. Will break compilation for programs
that rely on the enum name.

Bug: https://github.com/bagder/curl/pull/76
Reported-by: Shawn Landden
---
 include/curl/curl.h | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/curl/curl.h b/include/curl/curl.h
index 41c0881..0fb00e8 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -645,16 +645,18 @@ typedef enum {
 
 #define CURL_ERROR_SIZE 256
 
+enum curl_khtype {
+  CURLKHTYPE_UNKNOWN,
+  CURLKHTYPE_RSA1,
+  CURLKHTYPE_RSA,
+  CURLKHTYPE_DSS
+};
+
 struct curl_khkey {
   const char *key; /* points to a zero-terminated string encoded with base64
                       if len is zero, otherwise to the "raw" data */
   size_t len;
-  enum type {
-    CURLKHTYPE_UNKNOWN,
-    CURLKHTYPE_RSA1,
-    CURLKHTYPE_RSA,
-    CURLKHTYPE_DSS
-  } keytype;
+  enum curl_khtype keytype;
 };
 
 /* this is the set of return values expected from the curl_sshkeycallback
-- 
1.8.4.rc3

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to