diff options
author | Brett Cameron <Brett.Cameron@hp.com> | 2010-05-12 12:45:12 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-05-12 12:45:12 +0200 |
commit | 714a8d50a03e773320a02247847c58020c96e867 (patch) | |
tree | 6f443d803d7cd52573d77af068f6e030f114620e /src/uuid.cpp | |
parent | a25414e55caa975185ac6534c40bb601e5c38a9a (diff) |
fixes for OpenVMS
Diffstat (limited to 'src/uuid.cpp')
-rw-r--r-- | src/uuid.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/uuid.cpp b/src/uuid.cpp index 5991bfb..631a625 100644 --- a/src/uuid.cpp +++ b/src/uuid.cpp @@ -97,6 +97,35 @@ const char *zmq::uuid_t::to_string () return string_buf; } +#elif defined ZMQ_HAVE_OPENVMS + +#include <starlet.h> + +#define uuid_generate(x) sys$create_uid(&(x)) + +#define uuid_unparse(x, y) \ + sprintf (y, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", \ + x.data0, x.data1, x.data2, \ + x.data3 [0], x.data3 [1], \ + x.data3 [2], x.data3 [3], \ + x.data3 [4], x.data3 [5], \ + x.data3 [6], x.data3 [7]); + +zmq::uuid_t::uuid_t () +{ + uuid_generate (uuid); + uuid_unparse (uuid, string_buf); +} + +zmq::uuid_t::~uuid_t () +{ +} + +const char *zmq::uuid_t::to_string () +{ + return string_buf; +} + #else #include <stdio.h> |