2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file access library * |
* libgig - C++ cross-platform Gigasampler format file access library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2019 by Christian Schoenebeck * |
* Copyright (C) 2003-2020 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
556 |
} |
} |
557 |
|
|
558 |
void Resource::GenerateDLSID(dlsid_t* pDLSID) { |
void Resource::GenerateDLSID(dlsid_t* pDLSID) { |
|
#if defined(WIN32) || defined(__APPLE__) || defined(HAVE_UUID_GENERATE) |
|
559 |
#ifdef WIN32 |
#ifdef WIN32 |
560 |
UUID uuid; |
UUID uuid; |
561 |
UuidCreate(&uuid); |
UuidCreate(&uuid); |
580 |
pDLSID->abData[5] = uuid.byte13; |
pDLSID->abData[5] = uuid.byte13; |
581 |
pDLSID->abData[6] = uuid.byte14; |
pDLSID->abData[6] = uuid.byte14; |
582 |
pDLSID->abData[7] = uuid.byte15; |
pDLSID->abData[7] = uuid.byte15; |
583 |
#else |
#elif defined(HAVE_UUID_GENERATE) |
584 |
uuid_t uuid; |
uuid_t uuid; |
585 |
uuid_generate(uuid); |
uuid_generate(uuid); |
586 |
pDLSID->ulData1 = uuid[0] | uuid[1] << 8 | uuid[2] << 16 | uuid[3] << 24; |
pDLSID->ulData1 = uuid[0] | uuid[1] << 8 | uuid[2] << 16 | uuid[3] << 24; |
587 |
pDLSID->usData2 = uuid[4] | uuid[5] << 8; |
pDLSID->usData2 = uuid[4] | uuid[5] << 8; |
588 |
pDLSID->usData3 = uuid[6] | uuid[7] << 8; |
pDLSID->usData3 = uuid[6] | uuid[7] << 8; |
589 |
memcpy(pDLSID->abData, &uuid[8], 8); |
memcpy(pDLSID->abData, &uuid[8], 8); |
590 |
#endif |
#else |
591 |
|
# error "Missing support for uuid generation" |
592 |
#endif |
#endif |
593 |
} |
} |
594 |
|
|