Hi,
This is the patch I use for gcc4.0 here.
I am not really sure why this aliasing was introduced, but it will not work this way anymore.
Ciao, Marcus
diff -ruN -x CVS wine-20050419/include/msvcrt/conio.h marcus-wine-20050419/include/msvcrt/conio.h --- wine-20050419/include/msvcrt/conio.h 2004-07-19 13:07:44.000000000 +0200 +++ marcus-wine-20050419/include/msvcrt/conio.h 2005-04-13 13:03:23.000000000 +0200 @@ -53,7 +53,7 @@ static inline unsigned short outpw(unsigned short i, unsigned short j) { return _outpw(i, j); } #endif
-#ifdef __GNUC__ +#if defined(__GNUC__) && (__GNUC__ < 4) extern int cprintf(const char*,...) __attribute__((alias("_cprintf"),format(printf,1,2))); extern int cscanf(const char*,...) __attribute__((alias("_cscanf"),format(scanf,1,2))); #else diff -ruN -x CVS wine-20050419/include/msvcrt/io.h marcus-wine-20050419/include/msvcrt/io.h --- wine-20050419/include/msvcrt/io.h 2004-07-19 13:07:44.000000000 +0200 +++ marcus-wine-20050419/include/msvcrt/io.h 2005-04-13 13:03:23.000000000 +0200 @@ -175,7 +175,7 @@ #endif static inline int write(int fd, const void* buf, unsigned int size) { return _write(fd, buf, size); }
-#ifdef __GNUC__ +#if defined(__GNUC__) && (__GNUC__ < 4) extern int open(const char*,int,...) __attribute__((alias("_open"))); extern int sopen(const char*,int,int,...) __attribute__((alias("_sopen"))); #else diff -ruN -x CVS wine-20050419/include/msvcrt/process.h marcus-wine-20050419/include/msvcrt/process.h --- wine-20050419/include/msvcrt/process.h 2004-07-19 13:07:44.000000000 +0200 +++ marcus-wine-20050419/include/msvcrt/process.h 2005-04-13 13:03:23.000000000 +0200 @@ -125,7 +125,7 @@ static inline int spawnvp(int flags, const char* name, const char* const* argv) { return _spawnvp(flags, name, argv); } static inline int spawnvpe(int flags, const char* name, const char* const* argv, const char* const* envv) { return _spawnvpe(flags, name, argv, envv); }
-#ifdef __GNUC__ +#if defined(__GNUC__) && (__GNUC__ < 4) extern int execl(const char*,const char*,...) __attribute__((alias("_execl"))); extern int execle(const char*,const char*,...) __attribute__((alias("_execle"))); extern int execlp(const char*,const char*,...) __attribute__((alias("_execlp")));
On Sun, Apr 24, 2005 at 10:02:47PM +0200, Marcus Meissner wrote:
Hi,
This is the patch I use for gcc4.0 here.
I am not really sure why this aliasing was introduced, but it will not work this way anymore.
I still don't understand why it doesn't work.
It was introduced because using macros it not always acceptable. Some source uses these functions in ways that break if they are defined as macros.
Defining them as inline functions work, but we can't do so for varargs, in which case we used aliases.
What was the reason to break them, and why they don't work? They are aliasing to things that _are_ defined, so I'm not sure what is going on there.