2009-12-03 02:08:29 +00:00
|
|
|
/* Copyright (c) 2008-2009, Avian Contributors
|
2008-06-25 20:53:48 +00:00
|
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software
|
|
|
|
for any purpose with or without fee is hereby granted, provided
|
|
|
|
that the above copyright notice and this permission notice appear
|
|
|
|
in all copies.
|
|
|
|
|
|
|
|
There is NO WARRANTY for this software. See license.txt for
|
|
|
|
details. */
|
|
|
|
|
2008-03-31 03:43:43 +00:00
|
|
|
#include "stdlib.h"
|
|
|
|
|
2009-08-27 00:26:44 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
|
|
|
typedef unsigned char uint8_t;
|
|
|
|
|
|
|
|
#else // not _MSC_VER
|
|
|
|
|
|
|
|
# include "stdint.h"
|
|
|
|
|
2008-10-28 21:40:50 +00:00
|
|
|
// since we aren't linking against libstdc++, we must implement this
|
|
|
|
// ourselves:
|
2008-03-31 03:43:43 +00:00
|
|
|
extern "C" void __cxa_pure_virtual(void) { abort(); }
|
|
|
|
|
2009-08-27 00:26:44 +00:00
|
|
|
#endif // not _MSC_VER
|
|
|
|
|
|
|
|
#if (defined __MINGW32__) || (defined _MSC_VER)
|
2009-10-27 16:35:26 +00:00
|
|
|
# define EXPORT __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
# define EXPORT __attribute__ ((visibility("default")))
|
|
|
|
#endif
|
2008-11-29 23:08:14 +00:00
|
|
|
|
2009-10-27 15:41:00 +00:00
|
|
|
#ifdef BOOT_IMAGE
|
|
|
|
|
|
|
|
#if (defined __MINGW32__) || (defined _MSC_VER)
|
|
|
|
# define SYMBOL(x) binary_bootimage_bin_##x
|
|
|
|
#else
|
|
|
|
# define SYMBOL(x) _binary_bootimage_bin_##x
|
|
|
|
#endif
|
|
|
|
|
2008-11-29 23:08:14 +00:00
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
extern const uint8_t SYMBOL(start)[];
|
|
|
|
extern const uint8_t SYMBOL(end)[];
|
|
|
|
|
|
|
|
EXPORT const uint8_t*
|
|
|
|
bootimageBin(unsigned* size)
|
|
|
|
{
|
|
|
|
*size = SYMBOL(end) - SYMBOL(start);
|
|
|
|
return SYMBOL(start);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif//BOOT_IMAGE
|
|
|
|
|
|
|
|
#ifdef BOOT_CLASSPATH
|
|
|
|
|
2009-08-27 00:26:44 +00:00
|
|
|
#if (defined __MINGW32__) || (defined _MSC_VER)
|
2008-03-31 03:43:43 +00:00
|
|
|
# define SYMBOL(x) binary_classpath_jar_##x
|
|
|
|
#else
|
|
|
|
# define SYMBOL(x) _binary_classpath_jar_##x
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
extern const uint8_t SYMBOL(start)[];
|
|
|
|
extern const uint8_t SYMBOL(end)[];
|
|
|
|
|
|
|
|
EXPORT const uint8_t*
|
|
|
|
classpathJar(unsigned* size)
|
|
|
|
{
|
|
|
|
*size = SYMBOL(end) - SYMBOL(start);
|
|
|
|
return SYMBOL(start);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2008-11-29 23:08:14 +00:00
|
|
|
|
|
|
|
#endif//BOOT_CLASSPATH
|