#define TYPE_SIGNED_P(type) (((type)-1)<0LL)
#define _64_BIT_VALUE_FITS_SIGNED_P(value) ( (value) <= 0x7FFFFFFFFFFFFFFFLL )
+#define SLOT_SIGNED_P(result, type, slot) \
+ do { \
+ type slot_signed_p_struct; \
+ slot_signed_p_struct.slot = -1; \
+ (result) = slot_signed_p_struct.slot < 0; \
+ } while (0)
void type_name(FILE *output, int signed_p, int size) {
if (signed_p) {
#include <grovel/common.h>
int main(int argc, char**argv) {
+ int autotype_tmp;
FILE *output = argc > 1 ? fopen(argv[1], \"w\") : stdout;
fprintf(output, \";;;; This file has been automatically generated by \"
\"cffi-grovel.\\n;;;; Do not edit it by hand.\\n\\n\");
(c-format out "~% (")
(c-print-symbol out slot-lisp-name t)
(c-format out " ")
- (c-print-symbol out type)
+ (etypecase type
+ ((eql :auto)
+ (format out "~& SLOT_SIGNED_P(autotype_tmp, ~A, ~A~@[[0]~]);~@*~%~
+ ~& type_name(output, autotype_tmp, sizeofslot(~A, ~A~@[[0]~]));~%"
+ struct-c-name
+ slot-c-name
+ (not (null count))))
+ ((and symbol (not null))
+ (c-print-symbol out type))
+ (string
+ (c-format out "~A" type)))
(etypecase count
(null t)
(integer