Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Nov 2002 02:58:13 -0800
From:      Maxime Henrion <mux@freebsd.org>
To:        Patrick Hartling <patrick@137.org>
Cc:        current@freebsd.org, marcel@freebsd.org
Subject:   Re: uuid.h is not C++ safe
Message-ID:  <20021105105813.GD26605@elvis.mu.org>
In-Reply-To: <3DC71B56.1050102@137.org>
References:  <3DC71B56.1050102@137.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--imjhCm/Pyz7Rq5F2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Patrick Hartling wrote:
> I was just about to put the new DCE 1.1 UUID functions into use in some 
> C++ code, but linking fails because the function prototypes in uuid.h 
> are not protected with the __cplusplus/extern "C" bits.  It's easy 
> enough for me to fix my local copy, but I'm sure this same thing could 
> trip up other people.

This should be fixed with the attached patch.  Marcel, can you review
and commit it please ?

Cheers,
Maxime

--imjhCm/Pyz7Rq5F2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="uuid.patch"

Index: uuid.h
===================================================================
RCS file: /space2/ncvs/src/lib/libc/uuid/uuid.h,v
retrieving revision 1.1
diff -u -p -r1.1 uuid.h
--- uuid.h	30 Oct 2002 03:51:00 -0000	1.1
+++ uuid.h	5 Nov 2002 10:55:56 -0000
@@ -30,6 +30,7 @@
 #ifndef _UUID_H_
 #define	_UUID_H_
 
+#include <sys/cdefs.h>
 #include <sys/types.h>
 #include <sys/uuid.h>
 
@@ -45,6 +46,7 @@
 #define	uuid_s_invalid_string_uuid	2
 #define	uuid_s_no_memory		3
 
+__BEGIN_DECLS
 int32_t	uuid_compare(uuid_t *, uuid_t *, uint32_t *);
 void	uuid_create(uuid_t *, uint32_t *);
 void	uuid_create_nil(uuid_t *, uint32_t *);
@@ -53,5 +55,6 @@ void	uuid_from_string(const char *, uuid
 uint16_t uuid_hash(uuid_t *, uint32_t *);
 int32_t	uuid_is_nil(uuid_t *, uint32_t *);
 void	uuid_to_string(uuid_t *, char **, uint32_t *);
+__END_DECLS
 
 #endif	/* _UUID_H_ */

--imjhCm/Pyz7Rq5F2--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021105105813.GD26605>