mirror of
https://github.com/libretro/bsnes-libretro.git
synced 2024-11-23 17:09:44 +00:00
04986d2bf7
byuu says: Changelog: - port: various compilation fixes for OS X [kode54] - nall: added programpath() function to return path to process binary [todo: need to have ethos use this function] - ruby: XAudio2 will select default game sound device instead of first sound device - ruby: DirectInput device IDs are no longer ambiguous when VID+PID are identical - ruby: OpenGL won't try and terminate if it hasn't been initialized - gb: D-pad up+down/left+right not masked in SGB mode - sfc: rewrote ICD2 video rendering to output in real-time, work with cycle-based Game Boy renderer - sfc: rewrote Bus::reduce(), reduces game loading time by about 500ms - ethos: store save states in {game}/higan/* instead of {game}/bsnes/* - loki: added target-loki/ (blank stub for now) - Makefile: purge out/* on make clean
31 lines
800 B
C++
31 lines
800 B
C++
#ifndef NALL_WINDOWS_GUID_HPP
|
|
#define NALL_WINDOWS_GUID_HPP
|
|
|
|
#include <nall/random.hpp>
|
|
#include <nall/string.hpp>
|
|
|
|
namespace nall {
|
|
|
|
//generate unique GUID
|
|
inline string guid() {
|
|
LinearFeedbackShiftRegisterGenerator lfsr;
|
|
lfsr.seed(time(nullptr));
|
|
for(unsigned n = 0; n < 256; n++) lfsr();
|
|
|
|
string output;
|
|
for(unsigned n = 0; n < 4; n++) output.append(hex<2>(lfsr()));
|
|
output.append("-");
|
|
for(unsigned n = 0; n < 2; n++) output.append(hex<2>(lfsr()));
|
|
output.append("-");
|
|
for(unsigned n = 0; n < 2; n++) output.append(hex<2>(lfsr()));
|
|
output.append("-");
|
|
for(unsigned n = 0; n < 2; n++) output.append(hex<2>(lfsr()));
|
|
output.append("-");
|
|
for(unsigned n = 0; n < 6; n++) output.append(hex<2>(lfsr()));
|
|
return {"{", output, "}"};
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|