diff options
author | B Stack <bgstack15@gmail.com> | 2019-08-15 15:51:34 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-08-15 15:51:39 -0400 |
commit | 17994eb3eda9d2be9aad55dae41562ce13531d99 (patch) | |
tree | afc54ec004ab863262f5621fbf282c42fdff29cc /zen/guid.h | |
parent | Merge branch '10.14' into 'master' (diff) | |
download | FreeFileSync-17994eb3eda9d2be9aad55dae41562ce13531d99.tar.gz FreeFileSync-17994eb3eda9d2be9aad55dae41562ce13531d99.tar.bz2 FreeFileSync-17994eb3eda9d2be9aad55dae41562ce13531d99.zip |
add upstream 10.15
Diffstat (limited to 'zen/guid.h')
-rw-r--r-- | zen/guid.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -8,7 +8,7 @@ #define GUID_H_80425780237502345 #include <fcntl.h> //open - #include <unistd.h> //close + #include <unistd.h> //close, getentropy #include <zen/sys_error.h> //#include <uuid/uuid.h> -> uuid_generate(), uuid_unparse(); avoid additional dependency for "sudo apt-get install uuid-dev" @@ -19,6 +19,11 @@ inline std::string generateGUID() //creates a 16-byte GUID { std::string guid(16, '\0'); + +#ifndef __GLIBC__ +#error Where is GLIB? +#endif + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25) //getentropy() requires glibc 2.25 (ldd --version) PS: CentOS 7 is on 2.17 if (::getentropy(&guid[0], guid.size()) != 0) //"The maximum permitted value for the length argument is 256" throw std::runtime_error(std::string(__FILE__) + "[" + numberTo<std::string>(__LINE__) + "] Failed to generate GUID." + |