[plt-scheme] mzc from svn, getting new errors compiling mysql extension

From: Geoffrey S. Knauth (geoff at knauth.org)
Date: Sat Jan 19 13:49:31 EST 2008

On Jan 19, 2008, at 08:26, Geoffrey S. Knauth wrote:
Since updating from svn last night, I can no longer compile mysql- 
mzscheme glue code.  This worked a few days ago.  Did something change  
in mzc recently?

I built David Van Horn's mysql-drscheme interface using mzc v3.99.0.9   
and v372.  v372 compiled it OK, v3.99.0.9 did not.  In looking through  
mysqlclient3m.c generated by v372 vs. mysqlclient_ss3m.c generated by  
3.99.0.9, the C files were very similar for the first 1300 lines.  I  
noticed a declaration missing from the new one:

int mysql_refresh (MYSQL * mysql , unsigned int refresh_options ) ;

About 100 lines later, I started to see more significant differences.   
I'll just show one, which is typical.

C code generated by v3.99.0.9 that fails with a gcc error:

Scheme_Object * mzc_cffi_0 (int argc , Scheme_Object * * argv ) {
   /* No conversion */
   mysql_affected_rows }  /* error: syntax error before '}' token */

C code generated by v372 that compiled OK:

Scheme_Object * mzc_cffi_0 (int argc , Scheme_Object * * argv ) {
   MYSQL * ___arg1 ;
   unsigned long ___result ;
   Scheme_Object * converted_result ;
   DECL_RET_SAVE (Scheme_Object * ) PREPARE_VAR_STACK_ONCE(1);
   BLOCK_SETUP_TOP((PUSH(converted_result, 0)));
# define XfOrM1_COUNT (1)
# define SETUP_XfOrM1(x) SETUP(XfOrM1_COUNT)
# define BLOCK_SETUP(x) BLOCK_SETUP_once(x)
# define FUNCCALL(s, x) FUNCCALL_once(s, x)
# define FUNCCALL_EMPTY(x) FUNCCALL_EMPTY_once(x)
# define FUNCCALL_AGAIN(x) FUNCCALL_AGAIN_once(x)
   ___arg1 = NULLED_OUT ;
   converted_result = NULLED_OUT ;
   if (((((argv [0 ] ) ) == (scheme_false ) ) || ((((Scheme_Type )  
(((((long ) (argv [0 ] ) ) & 0x1 ) ? (Scheme_Type )  
scheme_integer_type : ((Scheme_Object * ) (argv [0 ] ) ) -> type ) )  
== (Scheme_Type ) (scheme_cpointer_type ) ) || ((Scheme_Type )  
(((((long ) (argv [0 ] ) ) & 0x1 ) ? (Scheme_Type )  
scheme_integer_type : ((Scheme_Object * ) (argv [0 ] ) ) -> type ) )  
== (Scheme_Type ) (scheme_offset_cpointer_type ) ) ) &&  
((Scheme_Type ) (((((long ) ((((Scheme_Cptr * ) (argv [0 ] ) ) ->  
type ) ) ) & 0x1 ) ? (Scheme_Type ) scheme_integer_type :  
((Scheme_Object * ) ((((Scheme_Cptr * ) (argv [0 ] ) ) -> type ) ) ) - 
 > type ) ) == (Scheme_Type ) (scheme_byte_string_type ) ) && !  
(strcmp ((((Scheme_Simple_Object * ) ((((Scheme_Cptr * ) (argv  
[0 ] ) ) -> type ) ) ) -> u . byte_str_val . string_val ) ,  
"MYSQL" ) ) ) ) ) {
     ___arg1 = ((! (((argv [0 ] ) ) == (scheme_false ) ) ) ?  
(((Scheme_Cptr * ) (argv [0 ] ) ) -> val ) : ((void * ) 0 ) ) ;
   }
   else {
#   define XfOrM3_COUNT (0+XfOrM1_COUNT)
#   define SETUP_XfOrM3(x) SETUP_XfOrM1(x)
     FUNCCALL_EMPTY(scheme_wrong_type ("affected-rows" , "cpointer of  
type \"MYSQL\" or #f" , 0 , argc , argv ) );
     RET_VALUE_START (((void * ) 0 ) ) RET_VALUE_END ;
   }
   {
#   define XfOrM2_COUNT (0+XfOrM1_COUNT)
#   define SETUP_XfOrM2(x) SETUP_XfOrM1(x)
     ___result = FUNCCALL(SETUP_XfOrM2(_), mysql_affected_rows  
(___arg1 ) );
     converted_result = FUNCCALL(SETUP_XfOrM2(_),  
scheme_make_integer_value_from_unsigned (___result ) );
   }
   RET_VALUE_START (converted_result ) RET_VALUE_END ;
# undef BLOCK_SETUP
# undef FUNCCALL
# undef FUNCCALL_EMPTY
# undef FUNCCALL_AGAIN
}



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080119/81c0ee08/attachment.html>

Posted on the users mailing list.