From d46411d317556f925984e7e5c0ea578c1ef5de99 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 18 Feb 2013 13:23:29 -0700 Subject: [PATCH] ffi/unsafe: add `_size', `_ssize', `_ptrdiff', `_intmax', `_uintmax' These additions could create backward-compatibility problems, but our searches suggest that problems will be rare; it's more common for `_size_t' to be incorrectly aliased to `_int', so having definitions for these standard types is likely to avoid future problems. --- collects/ffi/unsafe.rkt | 6 ++++++ collects/scribblings/foreign/types.scrbl | 9 +++++++++ doc/release-notes/racket/HISTORY.txt | 1 + 3 files changed, 16 insertions(+) diff --git a/collects/ffi/unsafe.rkt b/collects/ffi/unsafe.rkt index 56239c0fa2..89ca389223 100644 --- a/collects/ffi/unsafe.rkt +++ b/collects/ffi/unsafe.rkt @@ -93,6 +93,12 @@ (provide _intptr _uintptr _sintptr) (define-values (_intptr _uintptr _sintptr) (sizeof->3ints '(void *))) +(define* _size _uintptr) +(define* _ssize _intptr) +(define* _ptrdiff _intptr) +(define* _intmax _intptr) +(define* _uintmax _uintptr) + ;; ---------------------------------------------------------------------------- ;; Getting and setting library objects diff --git a/collects/scribblings/foreign/types.scrbl b/collects/scribblings/foreign/types.scrbl index b401f7f277..52335e0e31 100644 --- a/collects/scribblings/foreign/types.scrbl +++ b/collects/scribblings/foreign/types.scrbl @@ -151,6 +151,15 @@ correspond to @racket[_int16]. The @racket[_int] aliases correspond to the @racket[_intptr] aliases correspond to either @racket[_int32] or @racket[_int64], depending on the platform.} +@defthing*[([_size ctype?] + [_ssize ctype?] + [_ptrdiff ctype?] + [_intmax ctype?] + [_uintmax ctype?])]{ + +More aliases for basic integer types. The @racket[_size] and +@racket[_uintmax] types are aliases for @racket[_uintptr], and +the rest are aliases for @racket[_intptr].} @defthing*[([_fixnum ctype?] [_ufixnum ctype?])]{ diff --git a/doc/release-notes/racket/HISTORY.txt b/doc/release-notes/racket/HISTORY.txt index 1b101a1922..6c1e42bccb 100644 --- a/doc/release-notes/racket/HISTORY.txt +++ b/doc/release-notes/racket/HISTORY.txt @@ -1,4 +1,5 @@ Version 5.3.3.3 +ffi/unsafe: added _size, _ssize, _ptrdiff, _intmax, _uintmax ffi/vector: added f8vectors scribble: 'toc-hidden style on a part no longer hides ToC entries for sub-parts when rendering as HTML