From 1dbf4664d69c2bf09125c5159bf72e75dd52591f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Wed, 14 May 2025 10:11:00 +0200 Subject: [PATCH] boot: move early constants from main.d to boot.d --- src/c/boot.d | 23 ++++++++++++++++++++++- src/c/main.d | 20 -------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/c/boot.d b/src/c/boot.d index 15684066e..0eb97fed4 100644 --- a/src/c/boot.d +++ b/src/c/boot.d @@ -6,9 +6,30 @@ /* -- imports ------------------------------------------------------- */ #include +#include #include -/* -- implementation------------------------------------------------- */ +/* -- constants ----------------------------------------------------- */ + +const cl_object ecl_ct_Jan1st1970UT = ecl_make_fixnum(39052800); + +ecl_def_ct_base_string(ecl_ct_null_string,"",0,,const); + +ecl_def_ct_single_float(ecl_ct_default_rehash_size,1.5f,,const); +ecl_def_ct_single_float(ecl_ct_default_rehash_threshold,0.75f,,const); + +ecl_def_ct_single_float(ecl_ct_singlefloat_zero,0,,const); +ecl_def_ct_double_float(ecl_ct_doublefloat_zero,0,,const); +ecl_def_ct_long_float(ecl_ct_longfloat_zero,0,,const); + +ecl_def_ct_single_float(ecl_ct_singlefloat_minus_zero,-0.0,,const); +ecl_def_ct_double_float(ecl_ct_doublefloat_minus_zero,-0.0,,const); +ecl_def_ct_long_float(ecl_ct_longfloat_minus_zero,-0.0l,,const); + +ecl_def_ct_ratio(ecl_ct_plus_half,ecl_make_fixnum(1),ecl_make_fixnum(2),,const); +ecl_def_ct_ratio(ecl_ct_minus_half,ecl_make_fixnum(-1),ecl_make_fixnum(2),,const); + +/* -- implementation ------------------------------------------------ */ #if ECL_FIXNUM_BITS <= 32 /* 1GB */ diff --git a/src/c/main.d b/src/c/main.d index 0da0f993f..b8b075a82 100644 --- a/src/c/main.d +++ b/src/c/main.d @@ -106,26 +106,6 @@ ecl_boot(void) return 0; } -/* -- constants ----------------------------------------------------- */ - -const cl_object ecl_ct_Jan1st1970UT = ecl_make_fixnum(39052800); - -ecl_def_ct_base_string(ecl_ct_null_string,"",0,,const); - -ecl_def_ct_single_float(ecl_ct_default_rehash_size,1.5f,,const); -ecl_def_ct_single_float(ecl_ct_default_rehash_threshold,0.75f,,const); - -ecl_def_ct_single_float(ecl_ct_singlefloat_zero,0,,const); -ecl_def_ct_double_float(ecl_ct_doublefloat_zero,0,,const); -ecl_def_ct_long_float(ecl_ct_longfloat_zero,0,,const); - -ecl_def_ct_single_float(ecl_ct_singlefloat_minus_zero,-0.0,,const); -ecl_def_ct_double_float(ecl_ct_doublefloat_minus_zero,-0.0,,const); -ecl_def_ct_long_float(ecl_ct_longfloat_minus_zero,-0.0l,,const); - -ecl_def_ct_ratio(ecl_ct_plus_half,ecl_make_fixnum(1),ecl_make_fixnum(2),,const); -ecl_def_ct_ratio(ecl_ct_minus_half,ecl_make_fixnum(-1),ecl_make_fixnum(2),,const); - /* These two tags have a special meaning for the frame stack. */ ecl_def_ct_base_string(ecl_ct_ptag_string,"PROTECT-TAG",11,static,const);