List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:August 27 1999 8:13am
Subject:Poll: How to handle msqlUnixTime? (Was: mSQL 2.0.11)
View as plain text  

Clifford Meece wrote:

> cc-1515 cc: ERROR File = mSQL.xs, Line = 49
>   A value of type "int" cannot be assigned to an entity of type "char
> *".
> 
>       RETVAL = msqlUnixTimeToDate(clock);

I think the problem is in the following lines of msql.h:


  /*
	char 	* APIENTRY msqlUnixTimeToDate __ANSI_PROTO((time_t));
	char 	* APIENTRY msqlUnixTimeToTime __ANSI_PROTO((time_t));
  */

In other words: For whatever reason, these functions are now
commented out. Thus the C compiler treats them as undeclared
and creates a default prototype of

	int msqlUnixTimeToDate();
	int msqlUnixTimeToTime();

in which case your error messages are making perfect sense.

Ok, first a workaround for you: Remove the comment characters in msql.h
or remove the corresponding functions from dbd/dbd.xs.in.

Now my question to this list: How should I handle msqlUnixTimeToDate
in the future?

  - Remove them from the package DBD::mSQL? Safe from the package
    maintainer's view, but not upwards compatible. (How much people
    are using these functions, anyways?)
  - Rebuild them in Perl? Easy thing, but it could be helpfull if
    someone does for me. In general, it shouldn't be much more than
    calling localtime() and returning a string build from the
    values passed by localtime().
  - Make using this functions optional? For example, one could use

	perl Makefile.PL --with-msql-unixtime


Thanks for any response,

Jochen



-- 
Jochen Wiedmann						joe@stripped
Life has brown and green eyes. :-)			+49 7123 14887


Thread
mSQL 2.0.11Clifford Meece26 Aug
  • Poll: How to handle msqlUnixTime? (Was: mSQL 2.0.11)Jochen Wiedmann27 Aug