#include <gio/gio.h>

#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
# define SECTION __attribute__ ((section (".gresource.gpk"), aligned (8)))
#else
# define SECTION
#endif

static const SECTION union { const guint8 data[1272]; const double alignment; void * const ptr;}  gpk_resource_data = { {
  0x47, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  0x18, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 
  0x00, 0x00, 0x00, 0x28, 0x05, 0x00, 0x00, 0x00, 
  0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 
  0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 
  0x04, 0x00, 0x00, 0x00, 0xd4, 0xb5, 0x02, 0x00, 
  0xff, 0xff, 0xff, 0xff, 0xac, 0x00, 0x00, 0x00, 
  0x01, 0x00, 0x4c, 0x00, 0xb0, 0x00, 0x00, 0x00, 
  0xb4, 0x00, 0x00, 0x00, 0x4b, 0x50, 0x90, 0x0b, 
  0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 
  0x04, 0x00, 0x4c, 0x00, 0xb8, 0x00, 0x00, 0x00, 
  0xbc, 0x00, 0x00, 0x00, 0xb0, 0xb7, 0x24, 0x30, 
  0x01, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 
  0x06, 0x00, 0x4c, 0x00, 0xc4, 0x00, 0x00, 0x00, 
  0xc8, 0x00, 0x00, 0x00, 0x2e, 0x2b, 0x01, 0xcb, 
  0x04, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 
  0x0c, 0x00, 0x76, 0x00, 0xd8, 0x00, 0x00, 0x00, 
  0xe7, 0x04, 0x00, 0x00, 0x33, 0x04, 0x5d, 0xbf, 
  0x02, 0x00, 0x00, 0x00, 0xe7, 0x04, 0x00, 0x00, 
  0x0b, 0x00, 0x4c, 0x00, 0xf4, 0x04, 0x00, 0x00, 
  0xf8, 0x04, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 
  0x01, 0x00, 0x00, 0x00, 0x6f, 0x72, 0x67, 0x2f, 
  0x02, 0x00, 0x00, 0x00, 0x67, 0x6e, 0x6f, 0x6d, 
  0x65, 0x2f, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 
  0x67, 0x70, 0x6b, 0x2d, 0x70, 0x72, 0x65, 0x66, 
  0x73, 0x2e, 0x75, 0x69, 0x00, 0x00, 0x00, 0x00, 
  0x38, 0x15, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 
  0x78, 0xda, 0xd5, 0x58, 0xcb, 0x92, 0xd3, 0x38, 
  0x14, 0xdd, 0xf3, 0x15, 0x42, 0xdb, 0xc1, 0x79, 
  0x74, 0xc3, 0x54, 0x2f, 0x12, 0x53, 0xdd, 0x53, 
  0xc5, 0xa3, 0x8a, 0x05, 0x55, 0xdd, 0x33, 0x2c, 
  0x5d, 0xb2, 0x7c, 0x63, 0x6b, 0xa2, 0x48, 0x46, 
  0x92, 0xf3, 0x60, 0xc5, 0xd7, 0xf0, 0x61, 0x7c, 
  0xc9, 0x5c, 0xdb, 0x09, 0x9d, 0x87, 0x1c, 0x6c, 
  0x37, 0x3d, 0xc0, 0xce, 0x96, 0xee, 0xb1, 0x74, 
  0x8f, 0xee, 0xe3, 0xc8, 0x93, 0x97, 0xeb, 0x85, 
  0x24, 0x4b, 0x30, 0x56, 0x68, 0x35, 0xa5, 0xe3, 
  0xc1, 0x88, 0x12, 0x50, 0x5c, 0x27, 0x42, 0xa5, 
  0x53, 0xfa, 0xf7, 0xdd, 0xab, 0xe0, 0x8a, 0xbe, 
  0x0c, 0x9f, 0x4c, 0x9e, 0x06, 0x01, 0x79, 0x0d, 
  0x0a, 0x0c, 0x73, 0x90, 0x90, 0x95, 0x70, 0x19, 
  0x49, 0x25, 0x4b, 0x80, 0x5c, 0x0e, 0x2e, 0x46, 
  0x83, 0x11, 0x09, 0x02, 0x34, 0x12, 0xca, 0x81, 
  0x99, 0x31, 0x0e, 0xe1, 0x13, 0x42, 0x26, 0x06, 
  0x3e, 0x16, 0xc2, 0x80, 0x25, 0x52, 0xc4, 0x53, 
  0x9a, 0xba, 0xf9, 0x1f, 0xf4, 0x7e, 0xa1, 0xcb, 
  0xc1, 0xf8, 0x8a, 0x0e, 0x2b, 0x3b, 0x1d, 0xff, 
  0x0b, 0xdc, 0x11, 0x2e, 0x99, 0xb5, 0x53, 0xfa, 
  0xda, 0xcd, 0xaf, 0xf3, 0x5c, 0x0a, 0xce, 0x1c, 
  0x1a, 0x7e, 0x10, 0x2a, 0xd1, 0x2b, 0x4a, 0x44, 
  0x32, 0xa5, 0x89, 0x60, 0x52, 0xa7, 0x51, 0x6e, 
  0x60, 0x66, 0x69, 0x89, 0x44, 0x6c, 0x6e, 0x74, 
  0x0e, 0xc6, 0x6d, 0x88, 0x62, 0x0b, 0x98, 0x52, 
  0xce, 0x54, 0x34, 0xd3, 0xbc, 0xc0, 0xf9, 0x57, 
  0x4c, 0x5a, 0x98, 0x0c, 0x77, 0x06, 0x7e, 0xfb, 
  0x58, 0x9b, 0x04, 0x4c, 0xb4, 0x12, 0x89, 0xcb, 
  0x68, 0x38, 0xbe, 0xfa, 0x9e, 0x7d, 0x02, 0x33, 
  0x56, 0x48, 0x17, 0x65, 0x20, 0xd2, 0xcc, 0xd1, 
  0xf0, 0xf9, 0x8b, 0xd1, 0x09, 0x84, 0x67, 0x42, 
  0x26, 0xf5, 0xb3, 0xcf, 0xb9, 0x1b, 0xbd, 0xae, 
  0xdd, 0x89, 0xf5, 0x7a, 0x4c, 0x77, 0x76, 0xa7, 
  0x4b, 0x2d, 0x85, 0x15, 0xb1, 0x04, 0x1a, 0xde, 
  0x99, 0xe2, 0xc4, 0x8f, 0x3e, 0xbe, 0xfb, 0x30, 
  0x0b, 0x66, 0x52, 0xa1, 0x22, 0xa7, 0x73, 0x1a, 
  0xfe, 0xd9, 0x01, 0x10, 0x6b, 0xe7, 0xf4, 0xa2, 
  0x25, 0x46, 0x1b, 0x01, 0xca, 0x55, 0xc7, 0x49, 
  0x43, 0x0c, 0x00, 0x87, 0x67, 0x2b, 0xdb, 0x00, 
  0x6d, 0xce, 0x38, 0x86, 0x61, 0xd3, 0x32, 0x07, 
  0x44, 0xfb, 0xc9, 0x7e, 0xc7, 0x62, 0x90, 0x35, 
  0xdd, 0xb2, 0x7c, 0xbc, 0xa0, 0xfb, 0xf6, 0x3d, 
  0x48, 0xef, 0x4b, 0xbc, 0x0f, 0x97, 0x31, 0x29, 
  0x52, 0xa4, 0xc4, 0x3a, 0x66, 0x5c, 0x5b, 0xd0, 
  0xd1, 0x01, 0x8c, 0x2f, 0xda, 0x02, 0x65, 0x4d, 
  0x85, 0x33, 0x4c, 0x59, 0xc9, 0x1c, 0x43, 0x37, 
  0xa7, 0x74, 0x03, 0xb8, 0xe9, 0x6b, 0x82, 0x3c, 
  0xcf, 0x59, 0x0a, 0xc4, 0xea, 0xc2, 0x70, 0x20, 
  0x5c, 0xe3, 0x71, 0x09, 0x65, 0x77, 0xe3, 0x96, 
  0xb8, 0x8c, 0x21, 0xad, 0x4c, 0x91, 0x18, 0x08, 
  0x4e, 0x38, 0x26, 0x25, 0x56, 0x01, 0xad, 0x70, 
  0x42, 0x58, 0xb4, 0x5f, 0xe4, 0x05, 0x66, 0xfe, 
  0xa0, 0x71, 0x2f, 0xcc, 0x39, 0x23, 0x62, 0xb4, 
  0xb1, 0x87, 0x13, 0xfb, 0x53, 0xbb, 0x43, 0x77, 
  0x1b, 0x3c, 0x00, 0xb2, 0x64, 0xb2, 0xc0, 0x37, 
  0xa5, 0xcd, 0x82, 0xc9, 0xba, 0x50, 0xec, 0x81, 
  0x86, 0xfe, 0x0f, 0x4e, 0x86, 0x75, 0x04, 0x1c, 
  0x8c, 0x95, 0x4e, 0x60, 0x14, 0x9d, 0x67, 0x07, 
  0xd6, 0x39, 0x53, 0x49, 0xc7, 0x03, 0x9c, 0x09, 
  0x29, 0x3b, 0x42, 0x72, 0x6d, 0x45, 0x9d, 0x08, 
  0x23, 0x3f, 0x04, 0x47, 0x8f, 0xf7, 0x3b, 0x19, 
  0x1e, 0x45, 0x7a, 0x9b, 0xc8, 0xbf, 0xe5, 0x46, 
  0x97, 0x87, 0xb4, 0x5f, 0x40, 0xed, 0x76, 0x6c, 
  0x55, 0x8d, 0x45, 0x06, 0x72, 0x4d, 0x5b, 0x87, 
  0x76, 0x97, 0x8c, 0xc8, 0xea, 0x95, 0x62, 0x66, 
  0xa2, 0x5c, 0x63, 0x29, 0xdf, 0xd0, 0x50, 0x01, 
  0x66, 0x7e, 0x5b, 0xbc, 0xcd, 0x58, 0xb9, 0x41, 
  0xb7, 0xc9, 0x31, 0x15, 0x85, 0x6a, 0x84, 0x9d, 
  0xf0, 0xe0, 0xe7, 0xe2, 0xce, 0x00, 0xfc, 0x23, 
  0x60, 0xcb, 0x82, 0xc3, 0xb7, 0x25, 0xbe, 0xf9, 
  0xfc, 0xef, 0x5d, 0x13, 0x1e, 0x40, 0x9e, 0x97, 
  0x40, 0xc0, 0xd6, 0x6a, 0x6c, 0xf4, 0x6d, 0xed, 
  0xb3, 0x41, 0x76, 0xcf, 0x05, 0xa9, 0x3a, 0xb0, 
  0x62, 0x32, 0xa8, 0x5e, 0x91, 0x49, 0x90, 0xc8, 
  0x45, 0x15, 0x70, 0x27, 0x90, 0x26, 0xaa, 0x6e, 
  0xbf, 0x61, 0x86, 0x9e, 0x75, 0x86, 0x7e, 0xd2, 
  0x3d, 0x99, 0xe7, 0x35, 0x7e, 0x78, 0x8a, 0x76, 
  0x09, 0xc4, 0x3a, 0x43, 0xbb, 0x20, 0xee, 0x13, 
  0x74, 0xfc, 0xb8, 0x09, 0xfa, 0x57, 0x06, 0x7c, 
  0x7e, 0x53, 0x60, 0x19, 0x57, 0x75, 0x5c, 0xf2, 
  0x72, 0x20, 0xae, 0x06, 0xa2, 0x04, 0xb0, 0x00, 
  0x4b, 0xda, 0xb3, 0xa2, 0x97, 0x05, 0x79, 0x81, 
  0x2d, 0xd7, 0x96, 0x99, 0xa4, 0x57, 0x96, 0xc0, 
  0x1a, 0x8d, 0x48, 0x50, 0x97, 0xf7, 0x67, 0x24, 
  0x48, 0x20, 0x2e, 0xb0, 0x8b, 0xcc, 0xf4, 0x33, 
  0x82, 0x94, 0x96, 0xef, 0x4b, 0x90, 0xdb, 0xea, 
  0x8f, 0xd1, 0x1a, 0xdd, 0x22, 0x8a, 0x54, 0x46, 
  0xd5, 0x7c, 0x35, 0xad, 0xf3, 0xf2, 0x93, 0x47, 
  0xad, 0xc2, 0xb6, 0xa5, 0xf5, 0xa1, 0x8d, 0xb5, 
  0x0b, 0xcc, 0x00, 0x07, 0xb1, 0x04, 0x1b, 0x6d, 
  0xd5, 0xda, 0xff, 0xd1, 0x96, 0x0b, 0x0b, 0x51, 
  0xa1, 0x30, 0x67, 0xa5, 0x50, 0x1d, 0xbd, 0x4c, 
  0x0c, 0x5b, 0x45, 0x58, 0x91, 0x4b, 0xc5, 0xab, 
  0xcd, 0x39, 0xec, 0xef, 0xd4, 0xde, 0x2e, 0x1e, 
  0x37, 0x7b, 0xf6, 0x55, 0x74, 0x84, 0x27, 0xe5, 
  0x0a, 0xfb, 0x2b, 0x4a, 0x3b, 0x0e, 0x65, 0x3d, 
  0xee, 0xa8, 0xed, 0x9a, 0xd5, 0xf8, 0x59, 0x91, 
  0x7c, 0x46, 0x0a, 0xb6, 0xec, 0x93, 0x6f, 0x17, 
  0x98, 0xd9, 0x35, 0xad, 0xa2, 0x7c, 0xf4, 0x13, 
  0xfb, 0x58, 0x3d, 0xf2, 0xfb, 0x2d, 0xee, 0xd8, 
  0x73, 0xa7, 0xf9, 0x9c, 0x86, 0x78, 0xb1, 0x0c, 
  0x60, 0x0d, 0x1c, 0xc5, 0x60, 0x17, 0xb4, 0x40, 
  0x95, 0x1b, 0x59, 0xf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, 0x00, 0x00, 0x00, 0x00, 0x00, 
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  0x00, 0x28, 0x75, 0x75, 0x61, 0x79, 0x29, 0x70, 
  0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x6b, 0x69, 
  0x74, 0x2f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
} };

static GStaticResource static_resource = { gpk_resource_data.data, sizeof (gpk_resource_data.data), NULL, NULL, NULL };
extern GResource *gpk_get_resource (void);
GResource *gpk_get_resource (void)
{
  return g_static_resource_get_resource (&static_resource);
}
/*
  If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and
  destructors, in a sane way, including e.g. on library unload. If not you're on
  your own.

  Some compilers need #pragma to handle this, which does not work with macros,
  so the way you need to use this is (for constructors):

  #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
  #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor)
  #endif
  G_DEFINE_CONSTRUCTOR(my_constructor)
  static void my_constructor(void) {
   ...
  }

*/

#ifndef __GTK_DOC_IGNORE__

#if  __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)

#define G_HAS_CONSTRUCTORS 1

#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void);
#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void);

#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
/* Visual studio 2008 and later has _Pragma */

#define G_HAS_CONSTRUCTORS 1

/* We do some weird things to avoid the constructors being optimized
 * away on VS2015 if WholeProgramOptimization is enabled. First we
 * make a reference to the array from the wrapper to make sure its
 * references. Then we use a pragma to make sure the wrapper function
 * symbol is always included at the link stage. Also, the symbols
 * need to be extern (but not dllexport), even though they are not
 * really used from another object file.
 */

/* We need to account for differences between the mangling of symbols
 * for Win32 (x86) and x64 programs, as symbols on Win32 are prefixed
 * with an underscore but symbols on x64 are not.
 */
#ifdef _WIN64
#define G_MSVC_SYMBOL_PREFIX ""
#else
#define G_MSVC_SYMBOL_PREFIX "_"
#endif

#define G_DEFINE_CONSTRUCTOR(_func) G_MSVC_CTOR (_func, G_MSVC_SYMBOL_PREFIX)
#define G_DEFINE_DESTRUCTOR(_func) G_MSVC_DTOR (_func, G_MSVC_SYMBOL_PREFIX)

#define G_MSVC_CTOR(_func,_sym_prefix) \
  static void _func(void); \
  extern int (* _array ## _func)(void);              \
  int _func ## _wrapper(void) { _func(); g_slist_find (NULL,  _array ## _func); return 0; } \
  __pragma(comment(linker,"/include:" _sym_prefix # _func "_wrapper")) \
  __pragma(section(".CRT$XCU",read)) \
  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _wrapper;

#define G_MSVC_DTOR(_func,_sym_prefix) \
  static void _func(void); \
  extern int (* _array ## _func)(void);              \
  int _func ## _constructor(void) { atexit (_func); g_slist_find (NULL,  _array ## _func); return 0; } \
   __pragma(comment(linker,"/include:" _sym_prefix # _func "_constructor")) \
  __pragma(section(".CRT$XCU",read)) \
  __declspec(allocate(".CRT$XCU")) int (* _array ## _func)(void) = _func ## _constructor;

#elif defined (_MSC_VER)

#define G_HAS_CONSTRUCTORS 1

/* Pre Visual studio 2008 must use #pragma section */
#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1

#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
  section(".CRT$XCU",read)
#define G_DEFINE_CONSTRUCTOR(_func) \
  static void _func(void); \
  static int _func ## _wrapper(void) { _func(); return 0; } \
  __declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper;

#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
  section(".CRT$XCU",read)
#define G_DEFINE_DESTRUCTOR(_func) \
  static void _func(void); \
  static int _func ## _constructor(void) { atexit (_func); return 0; } \
  __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor;

#elif defined(__SUNPRO_C)

/* This is not tested, but i believe it should work, based on:
 * http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c
 */

#define G_HAS_CONSTRUCTORS 1

#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1
#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1

#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \
  init(_func)
#define G_DEFINE_CONSTRUCTOR(_func) \
  static void _func(void);

#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \
  fini(_func)
#define G_DEFINE_DESTRUCTOR(_func) \
  static void _func(void);

#else

/* constructors not supported for this compiler */

#endif

#endif /* __GTK_DOC_IGNORE__ */

#ifdef G_HAS_CONSTRUCTORS

#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(resource_constructor)
#endif
G_DEFINE_CONSTRUCTOR(resource_constructor)
#ifdef G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA
#pragma G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(resource_destructor)
#endif
G_DEFINE_DESTRUCTOR(resource_destructor)

#else
#warning "Constructor not supported on this compiler, linking in resources will not work"
#endif

static void resource_constructor (void)
{
  g_static_resource_init (&static_resource);
}

static void resource_destructor (void)
{
  g_static_resource_fini (&static_resource);
}
