diff options
author | Marc Laukien <marc@zeroc.com> | 2002-09-22 15:44:10 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-09-22 15:44:10 +0000 |
commit | f683ef370bcb987a9f96fc5da0793d71e3721d29 (patch) | |
tree | d0ef420f3cab12b8bab3563dbd71618adba704a3 /cpp/src/IceUtil/UUID.cpp | |
parent | minor (diff) | |
download | ice-f683ef370bcb987a9f96fc5da0793d71e3721d29.tar.bz2 ice-f683ef370bcb987a9f96fc5da0793d71e3721d29.tar.xz ice-f683ef370bcb987a9f96fc5da0793d71e3721d29.zip |
thread fixes
Diffstat (limited to 'cpp/src/IceUtil/UUID.cpp')
-rw-r--r-- | cpp/src/IceUtil/UUID.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/cpp/src/IceUtil/UUID.cpp b/cpp/src/IceUtil/UUID.cpp index 95ddb2a1d38..21bab48af46 100644 --- a/cpp/src/IceUtil/UUID.cpp +++ b/cpp/src/IceUtil/UUID.cpp @@ -1,50 +1,50 @@ -// ********************************************************************** -// -// Copyright (c) 2001 -// Mutable Realms, Inc. -// Huntsville, AL, USA -// -// All Rights Reserved -// -// ********************************************************************** - -#include <IceUtil/UUID.h> - -#ifdef _WIN32 -# include <rpc.h> -#else -extern "C" // uuid/uuid.h seems to miss extern "C" declarations. -{ -# include <uuid/uuid.h> -} -#endif - -using namespace std; - -string -IceUtil::generateUUID() -{ -#ifdef _WIN32 - - UUID uuid; - UuidCreate(&uuid); - - unsigned char* str; - UuidToString(&uuid, &str); - - string result(reinterpret_cast<char*>(str)); - RpcStringFree(&str); - return result; - -#else - - uuid_t uuid; - uuid_generate(uuid); - - char str[37]; - uuid_unparse(uuid, str); - - return str; - -#endif -} +// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <IceUtil/UUID.h>
+
+#ifdef _WIN32
+# include <rpc.h>
+#else
+extern "C" // uuid/uuid.h seems to miss extern "C" declarations.
+{
+# include <uuid/uuid.h>
+}
+#endif
+
+using namespace std;
+
+string
+IceUtil::generateUUID()
+{
+#ifdef _WIN32
+
+ UUID uuid;
+ UuidCreate(&uuid);
+
+ unsigned char* str;
+ UuidToString(&uuid, &str);
+
+ string result(reinterpret_cast<char*>(str));
+ RpcStringFree(&str);
+ return result;
+
+#else
+
+ uuid_t uuid;
+ uuid_generate(uuid);
+
+ char str[37];
+ uuid_unparse(uuid, str);
+
+ return str;
+
+#endif
+}
|