Compile on Freebsd (#1044)

* Compile on Freebsd

Small changes needed for compilation on Freebsd. Note that you'll have
to pass -DEQEMU_BUILD_ZLIB=OFF on the cmake command line. The bundled
zlib-ng does not build on Freebsd even though mainline zlib-ng does.

* Fix build errors: typo
This commit is contained in:
Jose123456
2020-05-09 12:40:33 -07:00
committed by GitHub
parent 7f3e4e3438
commit 914ea27406
5 changed files with 33 additions and 2 deletions
+13
View File
@@ -14,6 +14,10 @@
#include <CoreFoundation/CFUUID.h>
#endif
#ifdef __FreeBSD__
#include <uuid.h>
#endif
unsigned char hexDigitToChar(char ch)
{
if (ch > 47 && ch < 58)
@@ -126,6 +130,15 @@ EQ::Util::UUID EQ::Util::UUID::Generate()
return buffer;
#endif
#ifdef __FreeBSD__
uuid_t l_id;
char l_uuid[37];
uint32_t l_ignored;
uuid_create(&l_id, &l_ignored);
uuid_to_string(&l_id, (char**) &l_uuid, &l_ignored);
return FromString(l_uuid);
#endif
}
EQ::Util::UUID EQ::Util::UUID::FromString(const std::string &str)