Browse Source

use h_bool to hopefully prevent clang type conflicts

Nicolas Cannasse 6 years ago
parent
commit
fa6c4b28bb
3 changed files with 9 additions and 7 deletions
  1. 5 4
      src/hlmodule.h
  2. 1 1
      src/jit.c
  3. 3 2
      src/module.c

+ 5 - 4
src/hlmodule.h

@@ -116,14 +116,15 @@ void hl_code_free( hl_code *c );
 const uchar *hl_get_ustring( hl_code *c, int index );
 const uchar *hl_get_ustring( hl_code *c, int index );
 const char* hl_op_name( int op );
 const char* hl_op_name( int op );
 
 
+typedef unsigned char h_bool;
 hl_module *hl_module_alloc( hl_code *code );
 hl_module *hl_module_alloc( hl_code *code );
-int hl_module_init( hl_module *m, bool hot_reload );
-bool hl_module_patch( hl_module *m, hl_code *code );
+int hl_module_init( hl_module *m, h_bool hot_reload );
+h_bool hl_module_patch( hl_module *m, hl_code *code );
 void hl_module_free( hl_module *m );
 void hl_module_free( hl_module *m );
-bool hl_module_debug( hl_module *m, int port, bool wait );
+h_bool hl_module_debug( hl_module *m, int port, h_bool wait );
 
 
 jit_ctx *hl_jit_alloc();
 jit_ctx *hl_jit_alloc();
-void hl_jit_free( jit_ctx *ctx, bool can_reset );
+void hl_jit_free( jit_ctx *ctx, h_bool can_reset );
 void hl_jit_reset( jit_ctx *ctx, hl_module *m );
 void hl_jit_reset( jit_ctx *ctx, hl_module *m );
 void hl_jit_init( jit_ctx *ctx, hl_module *m );
 void hl_jit_init( jit_ctx *ctx, hl_module *m );
 int hl_jit_function( jit_ctx *ctx, hl_module *m, hl_function *f );
 int hl_jit_function( jit_ctx *ctx, hl_module *m, hl_function *f );

+ 1 - 1
src/jit.c

@@ -2205,7 +2205,7 @@ jit_ctx *hl_jit_alloc() {
 	return ctx;
 	return ctx;
 }
 }
 
 
-void hl_jit_free( jit_ctx *ctx, bool can_reset ) {
+void hl_jit_free( jit_ctx *ctx, h_bool can_reset ) {
 	free(ctx->vregs);
 	free(ctx->vregs);
 	free(ctx->opsPos);
 	free(ctx->opsPos);
 	free(ctx->startBuf);
 	free(ctx->startBuf);

+ 3 - 2
src/module.c

@@ -19,6 +19,7 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  * DEALINGS IN THE SOFTWARE.
  */
  */
+#include <hl.h>
 #include <hlmodule.h>
 #include <hlmodule.h>
 
 
 #ifdef HL_WIN
 #ifdef HL_WIN
@@ -387,7 +388,7 @@ static void hl_module_hash( hl_module *m ) {
 	}
 	}
 }
 }
 
 
-int hl_module_init( hl_module *m, bool hot_reload ) {
+int hl_module_init( hl_module *m, h_bool hot_reload ) {
 	int i;
 	int i;
 	jit_ctx *ctx;
 	jit_ctx *ctx;
 	// RESET globals
 	// RESET globals
@@ -517,7 +518,7 @@ int hl_module_init( hl_module *m, bool hot_reload ) {
 	return 1;
 	return 1;
 }
 }
 
 
-bool hl_module_patch( hl_module *m1, hl_code *c ) {
+h_bool hl_module_patch( hl_module *m1, hl_code *c ) {
 	int i1,i2;
 	int i1,i2;
 	bool has_changes = false;
 	bool has_changes = false;
 	jit_ctx *ctx = m1->jit_ctx;
 	jit_ctx *ctx = m1->jit_ctx;