Merge pull request #2644

a17efcb0 make this build on SunOS/Solaris (Pavel Maryanov)
This commit is contained in:
Riccardo Spagni 2017-11-14 21:31:09 +02:00
commit 922aaf4e2a
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
9 changed files with 42 additions and 3 deletions

View file

@ -40,6 +40,10 @@
#include <byteswap.h>
#endif
#if defined(__sun) && defined(__SVR4)
#include <endian.h>
#endif
#if defined(_MSC_VER)
#include <stdlib.h>

View file

@ -405,7 +405,7 @@ namespace tools
#else
std::string get_nix_version_display_string()
{
utsname un;
struct utsname un;
if(uname(&un) < 0)
return std::string("*nix: failed to get os version");

View file

@ -31,8 +31,13 @@
#pragma once
#if defined(__GNUC__)
#if defined(__sun) && defined(__SVR4)
#define INITIALIZER(name) __attribute__((constructor)) static void name(void)
#define FINALIZER(name) __attribute__((destructor)) static void name(void)
#else
#define INITIALIZER(name) __attribute__((constructor(101))) static void name(void)
#define FINALIZER(name) __attribute__((destructor(101))) static void name(void)
#endif
#define REGISTER_FINALIZER(name) ((void) 0)
#elif defined(_MSC_VER)