Skip to content

Instantly share code, notes, and snippets.

@shhyou
Last active December 26, 2020 16:10
Show Gist options
  • Save shhyou/b310703b122271264ae23a20166012c9 to your computer and use it in GitHub Desktop.
Save shhyou/b310703b122271264ae23a20166012c9 to your computer and use it in GitHub Desktop.
diff --git a/racket/src/cs/io.sls b/racket/src/cs/io.sls
index 59b90d0..d56fdca 100644
--- a/racket/src/cs/io.sls
+++ b/racket/src/cs/io.sls
@@ -212,6 +212,23 @@
(ftype-ref rktio_identity_t (a_bits) p)
(ftype-ref rktio_identity_t (b_bits) p)
(ftype-ref rktio_identity_t (c_bits) p))))
+
+ (define (rktio_date_to_vector p)
+ (let ([p (make-ftype-pointer rktio_date_t (ptr->address p))])
+ (vector
+ (ftype-ref rktio_date_t (nanosecond) p)
+ ;(ftype-ref rktio_date_t (second) p)
+ ;(ftype-ref rktio_date_t (minute) p)
+ ;(ftype-ref rktio_date_t (hour) p)
+ ;(ftype-ref rktio_date_t (day) p)
+ ;(ftype-ref rktio_date_t (month) p)
+ ;(ftype-ref rktio_date_t (year) p)
+ ;(ftype-ref rktio_date_t (day_of_week) p)
+ ;(ftype-ref rktio_date_t (day_of_year) p)
+ ;(ftype-ref rktio_date_t (is_dst) p)
+ ;(ftype-ref rktio_date_t (zone_offset) p)
+ ;(ftype-ref rktio_date_t (zone_name) p)
+ )))
(define (rktio_convert_result_to_vector p)
(let ([p (make-ftype-pointer rktio_convert_result_t (ptr->address p))])
@@ -356,6 +373,7 @@
'rktio_recv_length_ref rktio_recv_length_ref
'rktio_recv_address_ref rktio_recv_address_ref
'rktio_identity_to_vector rktio_identity_to_vector
+ 'rktio_date_to_vector rktio_date_to_vector
'rktio_convert_result_to_vector rktio_convert_result_to_vector
'rktio_to_bytes rktio_to_bytes
'rktio_to_bytes_list rktio_to_bytes_list
...
Whole-program optimization for Racket core...
[If this step runs out of memory, try configuring with `--disable-wpo`]
(time (compile-it))
950 collections
25.074155719s elapsed cpu time, including 15.058536000s collecting
25.633268000s elapsed real time, including 15.395759000s collecting
8127534064 bytes allocated, including 7256436928 bytes reclaimed
1156562944 bytes peak memory use
cd rktio; /Applications/Xcode.app/Contents/Developer/usr/bin/make
/Applications/Xcode.app/Contents/Developer/usr/bin/make hide_standalone_librktio
/Applications/Xcode.app/Contents/Developer/usr/bin/make librktio.a
make[8]: `librktio.a' is up to date.
/Applications/Xcode.app/Contents/Developer/usr/bin/make racketcs
ChezScheme/ta6osx/bin/ta6osx/scheme -B ChezScheme/ta6osx/boot/ta6osx/petite.boot -B ChezScheme/ta6osx/boot/ta6osx/scheme.boot --script ../../../cs/c/convert-to-boot.ss racket.so racket.boot ta6osx
mkdir -p Racket.framework/Versions/7.9.0.17_CS
gcc -o Racket.framework/Versions/7.9.0.17_CS/Racket -dynamiclib -all_load boot.o ChezScheme/ta6osx/boot/ta6osx/libkernel.a ChezScheme/ta6osx/boot/ta6osx/../../zlib/libz.a ChezScheme/ta6osx/boot/ta6osx/../../lz4/lib/liblz4.a rktio/librktio.a -Wl,-headerpad_max_install_names -ldl -lm -lncurses -framework CoreFoundation -liconv
rm -f Racket.framework/Racket
ln -s Versions/7.9.0.17_CS/Racket Racket.framework/Racket
mkdir -p Racket.framework/Versions/7.9.0.17_CS/boot
ChezScheme/ta6osx/bin/ta6osx/scheme -B ChezScheme/ta6osx/boot/ta6osx/petite.boot -B ChezScheme/ta6osx/boot/ta6osx/scheme.boot --script ../../../cs/c/to-vfasl.ss ChezScheme/ta6osx/boot/ta6osx/petite.boot Racket.framework/Versions/7.9.0.17_CS/boot/petite.boot
ChezScheme/ta6osx/bin/ta6osx/scheme -B ChezScheme/ta6osx/boot/ta6osx/petite.boot -B ChezScheme/ta6osx/boot/ta6osx/scheme.boot --script ../../../cs/c/to-vfasl.ss ChezScheme/ta6osx/boot/ta6osx/scheme.boot Racket.framework/Versions/7.9.0.17_CS/boot/scheme.boot petite
ChezScheme/ta6osx/bin/ta6osx/scheme -B ChezScheme/ta6osx/boot/ta6osx/petite.boot -B ChezScheme/ta6osx/boot/ta6osx/scheme.boot --script ../../../cs/c/to-vfasl.ss racket.boot Racket.framework/Versions/7.9.0.17_CS/boot/racket.boot petite scheme
gcc -g -O2 -Wall -DOS_X -IChezScheme/ta6osx/boot/ta6osx -I../../../cs/c/../../rktio -Irktio -I. -o raw_racketcs main.o -F. -framework Racket -Wl,-headerpad_max_install_names
/Applications/Xcode.app/Contents/Developer/usr/bin/make link-fw-bootfiles-fw
:
/Applications/Xcode.app/Contents/Developer/usr/bin/make adjust-framework-boot-compress
./raw_racketcs -O 'info@compiler/cm' -l- setup --boot ../../../cs/c/../../setup-go.rkt ./compiled ignored ./ignored.d ../../../cs/c/adjust-compress.rkt Racket.framework/Versions/7.9.0.17_CS/boot/petite.boot Racket.framework/Versions/7.9.0.17_CS/boot/scheme.boot Racket.framework/Versions/7.9.0.17_CS/boot/racket.boot
^C^C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment