racket/collects/mred/private/wx/common/once.rkt
Matthew Flatt d7f1d12ea1 clean up
2010-11-05 15:54:49 -06:00

15 lines
510 B
Racket

#lang racket/base
(require ffi/unsafe)
(provide (protect-out scheme_register_process_global))
;; This module must be instantiated only once:
(define scheme_register_process_global
(get-ffi-obj 'scheme_register_process_global #f (_fun _string _pointer -> _pointer)))
(let ([v (scheme_register_process_global "GRacket-support-initialized"
(cast 1 _scheme _pointer))])
(when v
(error "cannot instantiate `racket/gui/base' a second time in the same process")))