Problems extending Python 2.0 with FREE BORLAND C 5.5

Matthias Fischer mfischer at fh-brandenburg.de
Wed Nov 1 12:16:03 EST 2000


I'm working on a date-class for Python 2.0 with the FREE BORLAND C/C++
Compiler 5.5 using the extension template from : Gordon Williams

Everything works fine exept the print function which crashes.

static int Date_print(Dateobject *self, FILE *fp ,int flags)
{
    fprintf(fp,"%02ld.%02ld.%04ld",self->day,self->month,self->year);

    return 0 ;
}

So I changed the code to :

static int Date_print(Dateobject *self, FILE *fp ,int flags)
{
    printf("%02ld.%02ld.%04ld",self->day,self->month,self->year);  
    return 0 ;
}

Without using the FILE pointer everything is OK. But I think it would
be better to use FPRINTF in case of PRINTF. 

Is there something special about using these functions in Python 2.0 ?
Or does my DLL not have the rights to use the FILE-Pointer ?

I use the compiler with the following options :

LIBOPT	            =	-v- -Tpd -c    
C_FLAGS          =	-q -O1 -v- -tWM\
	-D_WINVER=0x0400\
	-D_WIN32_WINNT=0x0400\
	-DWIN32=1

Thanks for all the repsonses 
-- Matthias


  -----= Matthias Fischer =-----
      http://mfischer.de.cx
-----==mfischer at galaxy5.com==-----



More information about the Python-list mailing list