/[svn]/libgig/trunk/src/DLS.cpp
ViewVC logotype

Diff of /libgig/trunk/src/DLS.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3722 by schoenebeck, Thu Feb 28 17:49:07 2019 UTC revision 3723 by schoenebeck, Wed Jan 22 15:48:32 2020 UTC
# Line 2  Line 2 
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  *
# Line 556  namespace DLS { Line 556  namespace DLS {
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);
# Line 581  namespace DLS { Line 580  namespace DLS {
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            

Legend:
Removed from v.3722  
changed lines
  Added in v.3723

  ViewVC Help
Powered by ViewVC