clos: builtin classes have the same index independent of configure options

This is needed to allow for cross compiling from a compiler with a
different set of configure options (e.g. compiling for a target which
doesn't support complex floats from a host which does).
This commit is contained in:
Marius Gerbershagen 2025-06-14 20:17:35 +02:00
parent b194811ee3
commit 6a3605b768
2 changed files with 25 additions and 30 deletions

View file

@ -327,7 +327,7 @@ ecl_slot_value_set(cl_object x, const char *slot, cl_object value)
}
/**********************************************************************
* IMPORTANT: THE FOLLOWING LIST IS LINKED TO src/clos/builtin.lsp
* IMPORTANT: THE FOLLOWING LIST IS LINKED TO src/clos/hierarchy.lsp
**********************************************************************/
enum ecl_built_in_classes {
ECL_BUILTIN_T = 0,
@ -337,9 +337,7 @@ enum ecl_built_in_classes {
ECL_BUILTIN_ARRAY,
ECL_BUILTIN_VECTOR,
ECL_BUILTIN_STRING,
#ifdef ECL_UNICODE
ECL_BUILTIN_BASE_STRING,
#endif
ECL_BUILTIN_BIT_VECTOR,
ECL_BUILTIN_STREAM,
ECL_BUILTIN_ANSI_STREAM,
@ -364,12 +362,10 @@ enum ecl_built_in_classes {
ECL_BUILTIN_DOUBLE_FLOAT,
ECL_BUILTIN_LONG_FLOAT,
ECL_BUILTIN_COMPLEX,
#ifdef ECL_COMPLEX_FLOAT
ECL_BUILTIN_COMPLEX_FLOAT,
ECL_BUILTIN_COMPLEX_SINGLE_FLOAT,
ECL_BUILTIN_COMPLEX_DOUBLE_FLOAT,
ECL_BUILTIN_COMPLEX_LONG_FLOAT,
#endif
ECL_BUILTIN_SYMBOL,
ECL_BUILTIN_NULL,
ECL_BUILTIN_KEYWORD,
@ -383,20 +379,15 @@ enum ecl_built_in_classes {
ECL_BUILTIN_CODE_BLOCK,
ECL_BUILTIN_FOREIGN_DATA,
ECL_BUILTIN_FRAME,
ECL_BUILTIN_WEAK_POINTER
#ifdef ECL_THREADS
,
ECL_BUILTIN_WEAK_POINTER,
ECL_BUILTIN_PROCESS,
ECL_BUILTIN_LOCK,
ECL_BUILTIN_RWLOCK,
ECL_BUILTIN_CONDITION_VARIABLE,
ECL_BUILTIN_SEMAPHORE,
ECL_BUILTIN_BARRIER,
ECL_BUILTIN_MAILBOX
#endif
#ifdef ECL_SSE2
, ECL_BUILTIN_SSE_PACK
#endif
ECL_BUILTIN_MAILBOX,
ECL_BUILTIN_SSE_PACK
};
cl_object

View file

@ -186,8 +186,7 @@
(array)
(vector array sequence)
(string vector)
#+unicode
(base-string string vector)
(:unicode base-string string vector)
(bit-vector vector)
(stream)
(ext:ansi-stream stream)
@ -212,10 +211,10 @@
(double-float float)
(long-float float)
(complex number)
#+complex-float (si:complex-float complex)
#+complex-float (si:complex-single-float si:complex-float)
#+complex-float (si:complex-double-float si:complex-float)
#+complex-float (si:complex-long-float si:complex-float)
(:complex-float si:complex-float complex)
(:complex-float si:complex-single-float si:complex-float)
(:complex-float si:complex-double-float si:complex-float)
(:complex-float si:complex-long-float si:complex-float)
(symbol)
(null symbol list)
(keyword symbol)
@ -230,14 +229,14 @@
(si::foreign-data)
(si::frame)
(si::weak-pointer)
#+threads (mp::process)
#+threads (mp::lock)
#+threads (mp::rwlock)
#+threads (mp::condition-variable)
#+threads (mp::semaphore)
#+threads (mp::barrier)
#+threads (mp::mailbox)
#+sse2 (ext::sse-pack))))
(:threads mp::process)
(:threads mp::lock)
(:threads mp::rwlock)
(:threads mp::condition-variable)
(:threads mp::semaphore)
(:threads mp::barrier)
(:threads mp::mailbox)
(:sse2 ext::sse-pack))))
;;; FROM AMOP:
;;;
@ -335,9 +334,14 @@
:direct-slots #1#)
,@(loop for (name . rest) in +builtin-classes-list+
for index from 1
collect (list name :metaclass 'built-in-class
:index index
:direct-superclasses (or rest '(t))))
for feature-flag = (if (keywordp name)
(prog1 name
(setf name (first rest) rest (rest rest)))
nil)
when (or (not feature-flag) (member feature-flag *features*))
collect (list name :metaclass 'built-in-class
:index index
:direct-superclasses (or rest '(t))))
(funcallable-standard-object
:metaclass funcallable-standard-class
:direct-superclasses (standard-object function))