#include <gio/gio.h>

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

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

static GStaticResource static_resource = { ibus_kkc_resource_data.data, sizeof (ibus_kkc_resource_data.data), NULL, NULL, NULL };
extern GResource *ibus_kkc_get_resource (void);
GResource *ibus_kkc_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) {
   ...
  }

*/

#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

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

#define G_DEFINE_DESTRUCTOR(_func) \
  static void _func(void); \
  static int _func ## _constructor(void) { atexit (_func); return 0; } \
  __pragma(section(".CRT$XCU",read)) \
  __declspec(allocate(".CRT$XCU")) static 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


#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);
}
