flexible msvcrt.def.in

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

flexible msvcrt.def.in

Roumen Petrov
Since version 8.0 msvcrt switch to 64-bit time_t and rename about 10 32-
functions for XXX to _XXX32.

Now I'm thinking about this issue and I couldn't decide how to describe
rename of those functions in msvcrt.def.in.

Lets see a small part from msvcrt.def.in:
.....
_wutime64
#if ( __msvcr70__ || __msvcr70d__ ||  __msvcr71__ || __msvcr71d__ ||
__msvcr80__ || __msvcr80d__ || __msvcr90__ || __msvcr90d__)
; msvcr70.dll amd later
__buffer_overrun
.....
For the every new version of msvcrt file has to be changed in many
places to include new version number in #if statement.


A) What about file to be changed to use "#if __MSVCRT_VERSION__ <op>
<NUM>" ?
This require a change in makefile as example:
--- Makefile.in.ORIG    2008-09-24 03:56:05.000000000 +0300
+++ Makefile.in 2008-10-09 01:33:22.000000000 +0300
@@ -272,7 +272,11 @@
  msvcr80.def msvcr80d.def \
  msvcr90.def msvcr90d.def \
  : msvcrt.def.in
+       V=`echo $@ | sed -e 's|[a-z]*\([0-9]*\).*|\1|'`; \
+       test -z "$$V" && V=60; \
+       V="0x0$${V}0"; \
         $(CC) -DRUNTIME=$(basename $(notdir $@)) \
+               -D__MSVCRT_VERSION__=$$V \
                 -D__$(basename $(notdir $@))__=1 \
                 -D__MSVCRT__ -C -E -P \
                 -xc-header $? > $@


B) New description of functions for a particular crt-version.
IF we follow the current description of functions the new time functions
has to be added at end and their earlier description has to be included
in an if statement like this one #if  (__msvcrt__ || (__msvcrtd__ ||
__msvcr71__ || __msvcr71d__).


What about functions to be described in table with following columns:
function_name, first_cvr_version {, last_crt_version} ?

An awk or perl script can process this table and to output only
functions for a particular crt version. Also it is possible to use C-macro .
What about new description ans its implementation ?


Roumen

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: flexible msvcrt.def.in

Roumen Petrov
Roumen Petrov wrote:
> Since version 8.0 msvcrt switch to 64-bit time_t and rename about 10 32-
> functions for XXX to _XXX32.
>
> Now I'm thinking about this issue and I couldn't decide how to describe
> rename of those functions in msvcrt.def.in.
[SNIP]

What about awk script and following file format with description of
functions(items separated by blanks).

$ cat msvcrt.awk-list
0000    9999    EXPORTS
0000    0799    time
0800    9999    _time32
0000    9999    z123 DATA

$ cat msvcrt.awk
BEGIN {
   if (VER == "") VER=600
}

{
   if ($1 <= VER && VER <= $2) print $3 " " $4
}

And the results:
$ cat msvcrt.awk-list | awk -v VER=0800 -f msvcrt.awk
EXPORTS
_time32
z123 DATA

$ cat msvcrt.awk-list | awk -v VER=0600 -f msvcrt.awk
EXPORTS
time
z123 DATA


Roumen


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users