]> git.eshelyaron.com Git - emacs.git/commitdiff
add uintptr_type
authorAndrea Corallo <andrea_corallo@yahoo.it>
Wed, 26 Jun 2019 20:28:56 +0000 (22:28 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:46 +0000 (11:33 +0100)
src/comp.c

index 203d476df15290df9649cb1dd9da3ecc838123b4..5df67fe55f7ad4390a30a392b638c578977b3648 100644 (file)
@@ -187,6 +187,7 @@ typedef struct {
   gcc_jit_type *void_ptr_type;
   gcc_jit_type *char_ptr_type;
   gcc_jit_type *ptrdiff_type;
+  gcc_jit_type *uintptr_type;
   gcc_jit_type *lisp_obj_type;
   gcc_jit_type *lisp_obj_ptr_type;
   gcc_jit_field *lisp_obj_as_ptr;
@@ -1649,9 +1650,19 @@ init_comp (int opt_level)
     ptrdiff_t_gcc = GCC_JIT_TYPE_LONG_LONG;
   else
     eassert ("ptrdiff_t size not handled.");
-
   comp.ptrdiff_type = gcc_jit_context_get_type (comp.ctxt, ptrdiff_t_gcc);
 
+  enum gcc_jit_types uintptr_t_gcc;
+  if (sizeof (uintptr_t) == sizeof (unsigned))
+    uintptr_t_gcc = GCC_JIT_TYPE_UNSIGNED_INT;
+  else if (sizeof (uintptr_t) == sizeof (unsigned long))
+    uintptr_t_gcc = GCC_JIT_TYPE_UNSIGNED_LONG;
+  else if (sizeof (uintptr_t) == sizeof (unsigned long long))
+    uintptr_t_gcc = GCC_JIT_TYPE_UNSIGNED_LONG_LONG;
+  else
+    eassert ("uintptr_t size not handled.");
+  comp.uintptr_type = gcc_jit_context_get_type (comp.ctxt, uintptr_t_gcc);
+
   comp.func_hash = CALLN (Fmake_hash_table, QCtest, Qequal, QCweakness, Qt);
 
   /* Define data structures.  */