make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Bug report: Compile with Microsoft and Intel compiler


From: Jerker Bäck
Subject: RE: Bug report: Compile with Microsoft and Intel compiler
Date: Fri, 29 Apr 2005 05:31:40 +0200

You asked for the real prototypes - here they are:

These functions are defined in the runtime library and cannot be defined
again unless EXACTLY identical stated. All local defines of these functions
MUST therefore be disabled. Otherwise we get a fatal error 2373. How you
previously got MSC by this is mysterious.

List of redefines causing errors

Func      Microsoft     Borland
--------------------------------
chdir     <direct.h>    <dir.h>
dup2      <io.h>        <io.h>
environ   <stdlib.h>    <stdlib.h>
execve    <process.h>   <process.h>
_exit     <stdlib.h>    <stdlib.h>
getcwd    <direct.h>    <dir.h>
getenv    <stdlib.h>    <stdlib.h>
getpid    <process.h>   <process.h>
mktemp    <io.h>        <io.h>
strerror  <string.h>    <string.h>

(Borland also have direct.h)

Microsoft default prototypes:
------------------------------
_CRTIMP int __cdecl _chdir(const char *);
_CRTIMP int __cdecl _dup2(int, int);
_CRTIMP extern char ** _environ;
_CRTIMP int __cdecl _execve(const char *, const char * const *, const char *
const *);
_CRTIMP __declspec(noreturn) void   __cdecl _exit(int);
_CRTIMP char * __cdecl _getdcwd(int, char *, int);
_CRTIMP int __cdecl _getpid(void);
_CRTIMP char * __cdecl _mktemp(char *);
_CRTIMP char *  __cdecl _strerror(const char *);
_CRTIMP char *  __cdecl strerror(int);

there is also prototypes for oldnames.lib functions
(no underscore function aliases) and conditional directives
for compiler versions and ms extensions. 

Note: To make it even more complicated you're normally using the
UNICODE/MBCS safe defines in tchar.h

Ex:
MBCS defined:
#define _tchdir     _chdir

UNICODE defined:
#define _tchdir     _wchdir

OR
In case of a Windows GUI the Win32 API counterparts like:
wsprintf (used in w32err.c) - this is ugly - remove it.
This dependency actually loads the Windows user libraries (on my machine ~3
MB memory, luckily delay loading the rest)

-------------------------------

Borland have different prototypes

-------------------------------

So, if you plan what I think you're planning - don't, it's not a good idea.

Regards Jerker





reply via email to

[Prev in Thread] Current Thread [Next in Thread]