Skip to content

Commit 6818515

Browse files
committed
FIX: updated build scripts to be compatible with the recent CHECKSUM change
1 parent 99f1f73 commit 6818515

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/tools/common.reb

+14
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ if exists? opts: temp-dir/tmp-options.reb [
4747

4848

4949
;-- UTILITIES ----------------------------------------------------------
50+
; using checksum mezzanines to be able use build scripts also with old Rebol versions
51+
needs-new-checksum-version?: error? try [checksum #{}]
52+
crc24: func[data [binary!]] either needs-new-checksum-version? [
53+
[checksum data 'crc24]
54+
][ ; old R2 compatible:
55+
[checksum data]
56+
]
57+
; for some reason extensions are tested agains IP checksum :-/
58+
ipc: func[data [binary!]] either needs-new-checksum-version? [
59+
[checksum data 'tcp]
60+
][ ; old R2 compatible:
61+
[checksum/tcp data]
62+
]
63+
5064

5165
error: func[msg [string! block!]][
5266
if block? msg [msg: reform msg]

src/tools/make-boot.reb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ emit [
11841184
{
11851185
#define MAX_NATS } nat-count {
11861186
#define NAT_SPEC_SIZE } length? comp-data {
1187-
#define CHECK_TITLE } checksum to binary! title {
1187+
#define CHECK_TITLE } crc24 to binary! title {
11881188
11891189
extern const REBYTE Native_Specs[];
11901190
extern const REBFUN Native_Funcs[];

src/tools/make-os-ext.reb

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,13 @@ foreach file files [
147147

148148
remit "} REBOL_HOST_LIB;"
149149

150+
;@@ TODO: there is used IP checksum form HOST_LIB
151+
;@@ but CRC24 for boot data
150152
out: rejoin [
151153
form-header/gen "Host Access Library" %host-lib.h %make-os-ext.reb
152154
{
153155
#define HOST_LIB_VER } lib-version {
154-
#define HOST_LIB_SUM } checksum/tcp to-binary xsum {
156+
#define HOST_LIB_SUM } ipc to-binary xsum {
155157
#define HOST_LIB_SIZE } cnt {
156158
157159
extern REBDEV *Devices[];

0 commit comments

Comments
 (0)