Msvcrt headers part 1

Francois Gouget fgouget at free.fr
Mon Apr 9 22:06:59 CDT 2001


   There was more work than I expected, and I've been more busy than
expected too. This makes for very late msvcrt headers but here they are
finally.

   If you look at the new headers (see diff20010408-msvcrt2.txt in
part2) you'll notice the USE_MSVCRT_PREFIX macro. The goal of this macro
is to allow the use of the msvcrt headers in situations where one still
wants access to the native C library functions. This has great benefits
as it allows us to use them in the msvcrt implementation for instance.

   When USE_MSVCRT_PREFIX is defined, all the functions that may
conflict are prefixed with 'MSVCRT_'. Note the 'may conflict' above. The
goal is to not prefix functions unless necessary so that the code is
more readable.

   The general rule is:

 * all functions starting with '_' are not prefixed because no function
in the C library starts with a single '_'.
   E.g.: _chdir, _open, _execle, ...
   Exception: _errno (too often messed with)

 * all functions starting with '__p_' are not prefixed either. These are
very msvcrt specific functions used to access per thread data or regular
dll variables.

 * msvcrt specific functions are not prefixed like _beginthread

 * all others are prefixed

   Of course, if USE_MSVCRT_PREFIX is not defined, no prefix is added
which makes it possible to recompile windows source code unchanged.


   The consequence of this is that there has been a lot of renaming in
dlls/msvcrt to match the names used in the headers. This is the subject
of this first patch:

diff20010408-msvcrt1.txt - Changelog:

 * dlls/msvcrt/msvcrt.spec,
   dlls/msvcrt/console.c,
   dlls/msvcrt/cpp.c,
   dlls/msvcrt/ctype.c,
   dlls/msvcrt/data.c,
   dlls/msvcrt/dir.c,
   dlls/msvcrt/environ.c,
   dlls/msvcrt/errno.c,
   dlls/msvcrt/except.c,
   dlls/msvcrt/exit.c,
   dlls/msvcrt/file.c,
   dlls/msvcrt/heap.c,
   dlls/msvcrt/locale.c,
   dlls/msvcrt/main.c,
   dlls/msvcrt/math.c,
   dlls/msvcrt/mbcs.c,
   dlls/msvcrt/misc.c,
   dlls/msvcrt/msvcrt.h,
   dlls/msvcrt/process.c,
   dlls/msvcrt/string.c,
   dlls/msvcrt/thread.c,
   dlls/msvcrt/time.c,
   dlls/msvcrt/wcs.c

   Adjust the 'MSVCRT_' prefix to match the msvcrt headers
   Prefix internal methods with 'msvcrt_' instead of 'MSVCRT_', '__MSVCRT_', etc.
   Remove '_cdecl', it's unnecessary


--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
      Broadcast message : fin du monde dans cinq minutes, repentez vous !


-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff20010408-msvcrt1.txt.gz
Type: application/octet-stream
Size: 32520 bytes
Desc: diff20010408-msvcrt1.txt.gz
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20010409/6fc33910/diff20010408-msvcrt1.txt.obj


More information about the wine-patches mailing list