Minor fixes, fix compilation without HashLink library

This commit is contained in:
Joshua Granick
2018-06-11 13:10:17 -07:00
parent 68d24b1dc4
commit 5c407fe87b
30 changed files with 96 additions and 65 deletions

View File

@@ -16,7 +16,8 @@
<!-- <set name="LIME_FAUDIO" value="1" /> -->
<set name="LIME_FREETYPE" value="1" />
<set name="LIME_HARFBUZZ" value="1" />
<set name="LIME_HASHLINK" value="1" if="windows || mac || linux" />
<!-- <set name="LIME_HASHLINK" value="1" if="windows || mac || linux" /> -->
<set name="LIME_HASHLINK" value="1" if="hashlink" />
<set name="LIME_LZMA" value="1" />
<set name="LIME_MBEDTLS" value="1" unless="emscripten" />
<!-- <set name="LIME_NEKO" value="1" if="linux" /> -->
@@ -56,7 +57,6 @@
<files id="lime">
<compilerflag value="-Iinclude" />
<compilerflag value="-DLIBHL_EXPORTS" />
<file name="src/ExternalInterface.cpp" />
@@ -125,8 +125,8 @@
<section if="LIME_HASHLINK">
<!-- <compilerflag value="-I${HLPATH}/include" /> -->
<!-- <compilerflag value="-DLIBHL_EXPORTS" /> -->
<compilerflag value="-DLIME_HASHLINK" />
</section>
@@ -288,6 +288,7 @@
<file name="src/math/Vector2.cpp" />
<file name="src/media/containers/WAV.cpp" />
<file name="src/media/AudioBuffer.cpp" />
<file name="src/system/CFFI.cpp" />
<file name="src/system/CFFIPointer.cpp" />
<file name="src/system/ClipboardEvent.cpp" />
<file name="src/system/DisplayMode.cpp" />
@@ -391,8 +392,8 @@
<lib name="comdlg32.lib" />
<lib name="comsuppw.lib" />
<lib name="-libpath:${HLPATH}" />
<lib name="libhl.lib" />
<lib name="-libpath:${HLPATH}" if="LIME_HASHLINK" />
<lib name="libhl.lib" if="LIME_HASHLINK" />
<!-- <lib name="-delayload:libhl.dll" /> -->
</section>

View File

@@ -2,8 +2,7 @@
#define LIME_APP_APPLICATION_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>

View File

@@ -2,10 +2,9 @@
#define LIME_GRAPHICS_IMAGE_H
#include <hl.h>
#include <hx/CFFI.h>
#include <graphics/ImageBuffer.h>
#include <math/Rectangle.h>
#include <system/CFFI.h>
namespace lime {

View File

@@ -2,9 +2,8 @@
#define LIME_GRAPHICS_IMAGE_BUFFER_H
#include <hl.h>
#include <hx/CFFI.h>
#include <graphics/PixelFormat.h>
#include <system/CFFI.h>
#include <utils/ArrayBufferView.h>

View File

@@ -2,8 +2,7 @@
#define LIME_GRAPHICS_RENDER_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>

View File

@@ -2,8 +2,7 @@
#define LIME_MATH_MATRIX_3_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
namespace lime {

View File

@@ -2,8 +2,7 @@
#define LIME_MATH_RECTANGLE_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
namespace lime {

View File

@@ -2,8 +2,7 @@
#define LIME_MATH_VECTOR2_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
namespace lime {

View File

@@ -0,0 +1,16 @@
#ifndef LIME_SYSTEM_CFFI_H
#define LIME_SYSTEM_CFFI_H
#define HL_NAME(n) hl_##n
#include <hl.h>
#include <hx/CFFIPrime.h>
#ifndef LIME_HASHLINK
// define stubs in CFFI.cpp
#endif
#endif

View File

@@ -2,8 +2,7 @@
#define LIME_SYSTEM_CFFI_POINTER_H
#include <hl.h>
#include <hx/CFFIPrime.h>
#include <system/CFFI.h>
namespace hx {

View File

@@ -2,8 +2,7 @@
#define LIME_SYSTEM_CLIPBOARD_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>

View File

@@ -2,8 +2,7 @@
#define LIME_SYSTEM_SENSOR_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>

View File

@@ -2,8 +2,7 @@
#define LIME_SYSTEM_VALUE_POINTER_H
#include <hl.h>
#include <hx/CFFIPrime.h>
#include <system/CFFI.h>
namespace lime {

View File

@@ -2,8 +2,7 @@
#define LIME_UI_DROP_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>

View File

@@ -2,8 +2,7 @@
#define LIME_UI_GAMEPAD_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>

View File

@@ -2,8 +2,7 @@
#define LIME_UI_JOYSTICK_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>

View File

@@ -2,8 +2,7 @@
#define LIME_UI_KEY_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>
#include <stdint.h>

View File

@@ -2,8 +2,7 @@
#define LIME_UI_MOUSE_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>
#include <stdint.h>

View File

@@ -2,8 +2,7 @@
#define LIME_UI_TEXT_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>
#include <stdint.h>

View File

@@ -2,8 +2,7 @@
#define LIME_UI_TOUCH_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>
#include <stdint.h>

View File

@@ -6,9 +6,9 @@
#undef CreateWindow
#endif
#include <hl.h>
#include <app/Application.h>
#include <graphics/ImageBuffer.h>
#include <system/CFFI.h>
#include <system/DisplayMode.h>
#include <stdint.h>

View File

@@ -2,8 +2,7 @@
#define LIME_UI_WINDOW_EVENT_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <system/ValuePointer.h>
#include <stdint.h>

View File

@@ -2,8 +2,7 @@
#define LIME_UTILS_ARRAY_BUFFER_VIEW_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <utils/Bytes.h>

View File

@@ -2,8 +2,7 @@
#define LIME_UTILS_BYTES_H
#include <hl.h>
#include <hx/CFFI.h>
#include <system/CFFI.h>
#include <utils/QuickVec.h>

View File

@@ -2,7 +2,7 @@
#define LIME_UTILS_STRING_H
#include <hl.h>
#include <system/CFFI.h>
namespace lime {

View File

@@ -6,11 +6,8 @@
#define NEKO_COMPATIBLE
#endif
#include <system/CFFI.h>
#define HL_NAME(n) hl_##n
#include <hl.h>
#include <hx/CFFIPrime.h>
#include <app/Application.h>
#include <app/ApplicationEvent.h>
#include <graphics/format/JPEG.h>
@@ -450,6 +447,13 @@ namespace lime {
}
HL_PRIM double hl_lime_bytes_get_data_pointer (HL_Bytes* bytes) {
return bytes ? (uintptr_t)bytes->b : 0;
}
double lime_bytes_get_data_pointer_offset (value bytes, int offset) {
Bytes data = Bytes (bytes);
@@ -4188,7 +4192,7 @@ namespace lime {
DEFINE_HL_PRIM (_BOOL, lime_application_update, _TCFFIPOINTER);
// DEFINE_PRIME2 (lime_audio_load);
// DEFINE_PRIME2 (lime_bytes_from_data_pointer);
// DEFINE_PRIME1 (lime_bytes_get_data_pointer);
DEFINE_HL_PRIM (_F64, lime_bytes_get_data_pointer, _BYTES);
// DEFINE_PRIME2 (lime_bytes_get_data_pointer_offset);
// DEFINE_PRIME2 (lime_bytes_read_file);
// DEFINE_PRIME1 (lime_cffi_get_native_pointer);
@@ -4294,7 +4298,7 @@ namespace lime {
// DEFINE_PRIME0 (lime_system_get_platform_label);
// DEFINE_PRIME0 (lime_system_get_platform_name);
// DEFINE_PRIME0 (lime_system_get_platform_version);
// DEFINE_PRIME0 (lime_system_get_timer);
DEFINE_HL_PRIM (_F64, lime_system_get_timer, _NO_ARG);
// DEFINE_PRIME1 (lime_system_get_windows_console_mode);
// DEFINE_PRIME1v (lime_system_open_file);
// DEFINE_PRIME2v (lime_system_open_url);

View File

@@ -1,12 +1,9 @@
#define HL_NAME(n) hl_##n
#include <hl.h>
#include <cairo.h>
#include <cairo-ft.h>
#include <map>
#include <math/Matrix3.h>
#include <math/Vector2.h>
#include <hx/CFFIPrime.h>
#include <system/CFFI.h>
#include <system/CFFIPointer.h>
#include <system/Mutex.h>
#include <system/ValuePointer.h>

View File

@@ -12,10 +12,7 @@
#endif
#endif
#define HL_NAME(n) hl_##n
#include <hl.h>
#include <hx/CFFIPrime.h>
#include <system/CFFI.h>
#include <system/CFFIPointer.h>
#include <system/Mutex.h>
#include <utils/ArrayBufferView.h>

View File

@@ -0,0 +1,37 @@
#include <system/CFFI.h>
#ifndef LIME_HASHLINK
HL_API hl_type hlt_void = hl_type ();
HL_API hl_type hlt_i32 = hl_type ();
HL_API hl_type hlt_i64 = hl_type ();
HL_API hl_type hlt_f64 = hl_type ();
HL_API hl_type hlt_f32 = hl_type ();
HL_API hl_type hlt_dyn = hl_type ();
HL_API hl_type hlt_array = hl_type ();
HL_API hl_type hlt_bytes = hl_type ();
HL_API hl_type hlt_dynobj = hl_type ();
HL_API hl_type hlt_bool = hl_type ();
HL_API hl_type hlt_abstract = hl_type ();
HL_API varray *hl_alloc_array( hl_type *t, int size ) { return 0; }
HL_API vdynobj *hl_alloc_dynobj( void ) { return 0; }
HL_API char *hl_to_utf8( const uchar *bytes ) { return 0; }
HL_API int hl_hash_utf8 ( const char *str ) { return 0; }
HL_API vdynamic *hl_dyn_call( vclosure *c, vdynamic **args, int nargs ) { return 0; }
HL_API void hl_dyn_seti( vdynamic *d, int hfield, hl_type *t, int value ) {}
HL_API void hl_dyn_setp( vdynamic *d, int hfield, hl_type *t, void *ptr ) {}
HL_API void hl_dyn_setf( vdynamic *d, int hfield, float f ) {}
HL_API void hl_dyn_setd( vdynamic *d, int hfield, double v ) {}
HL_API void *hl_gc_alloc_gen( hl_type *t, int size, int flags ) { return 0; }
HL_API void hl_add_root( void *ptr ) {}
HL_API void hl_remove_root( void *ptr ) {}
HL_API void hl_gc_major( void ) {}
HL_API bool hl_is_gc_ptr( void *ptr ) { return false; }
#endif