On Tue, 2009-02-10 at 19:12 +0100, Julian Stecklina wrote: > Hello, > > I am trying to grovel some constants from libraw1394 and came across > this problem: > > libraw1394/csr.h contains: > #define CSR_REGISTER_BASE 0xfffff0000000ULL > > Grovelling this using > (include "libraw1394/csr.h") > (constant (+csr-register-base+ "CSR_REGISTER_BASE")) > sets +csr-register-base+ to -268435456. > > This is with the current version of cffi from darcs on SBCL 1.0.25 > (Linux x86).
I too use this configuration and I get (cl:defconstant +csr-register-base+ 281474708275200) What gcc version are you using ? Could you compile and run the attached C file and tell me what it reports ? -- Stelian Ionescu a.k.a. fe[nl]ix Quidquid latine dictum sit, altum videtur.
/* * This file has been automatically generated by cffi-grovel. * Do not edit it by hand. */ #include <libraw1394/csr.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> #ifndef offsetof #define offsetof(type, slot) ((int) ((char *) &(((type *) 0)->slot))) #endif #define sizeofslot(type, slot) (sizeof(((type *) 0)->slot)) #define stringify(x) #x #define indirect_stringify(x) stringify(x) #define SIGNEDP(x) (((x)-1)<0) #define SIGNED_(x) (SIGNEDP(x)?"":"un") #define SIGNED64P(x) ( x <= 0x7FFFFFFFFFFFFFFFLL ) void type_name(FILE *output, int signed_p, int size); int main(int argc, char**argv) { 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"); /* constant section for +CSR-REGISTER-BASE+ */ #ifdef CSR_REGISTER_BASE fprintf(output, "(cl:defconstant "); fprintf(output, "+csr-register-base+"); fprintf(output, " "); if(SIGNED64P(CSR_REGISTER_BASE)) fprintf(output, "%lli", (int64_t) CSR_REGISTER_BASE); else fprintf(output, "%llu", (uint64_t) CSR_REGISTER_BASE); fprintf(output, ")\n"); #else fprintf(output, "(cl:warn 'cffi-grovel:missing-definition :name '+CSR-REGISTER-BASE+)\n"); #endif if (output != stdout) fclose(output); return 0; } void type_name(FILE *output, int signed_p, int size) { if (signed_p) { switch (size) { case 1: fprintf(output, ":int8"); break; case 2: fprintf(output, ":int16"); break; case 4: fprintf(output, ":int32"); break; case 8: fprintf(output, ":int64"); break; default: goto error; } } else { switch(size) { case 1: fprintf(output, ":uint8"); break; case 2: fprintf(output, ":uint16"); break; case 4: fprintf(output, ":uint32"); break; case 8: fprintf(output, ":uint64"); break; default: goto error; } } return; error: fprintf(output, "(cl:error \"No type of size ~D.\" %i)\n", size); }
signature.asc
Description: This is a digitally signed message part
_______________________________________________ cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel