[CRT] Fix some _CRTIMP

Get rid of the ugly __MINGW_IMP_SYMBOL hacks.
This commit is contained in:
Timo Kreuzer 2021-07-31 17:15:30 +02:00
parent b05cc36208
commit 379957424c
4 changed files with 12 additions and 56 deletions

View file

@ -22,20 +22,10 @@ extern "C" {
#endif /* defined (_DLL) && defined (_M_IX86) */ #endif /* defined (_DLL) && defined (_M_IX86) */
#endif #endif
#ifndef _mbctype #ifndef _mbctype
#ifdef _MSVCRT_ _CRTIMP extern unsigned char _mbctype[257];
extern unsigned char _mbctype[257];
#else
#define _mbctype (*_imp___mbctype)
extern unsigned char **_imp___mbctype;
#endif
#endif #endif
#ifndef _mbcasemap #ifndef _mbcasemap
#ifdef _MSVCRT_ _CRTIMP extern unsigned char _mbcasemap[257];
extern unsigned char *_mbcasemap;
#else
#define _mbcasemap (*_imp___mbcasemap)
extern unsigned char **_imp___mbcasemap;
#endif
#endif #endif
/* CRT stuff */ /* CRT stuff */

View file

@ -21,7 +21,7 @@ extern "C" {
#ifdef __REACTOS__ #ifdef __REACTOS__
#include "malloc.h" #include "malloc.h"
struct _exception; struct _exception;
__declspec(dllimport) void __cdecl __setusermatherr(int (__cdecl *)(struct _exception *)); _CRTIMP void __cdecl __setusermatherr(int (__cdecl *)(struct _exception *));
#define __mingw_fprintf fprintf #define __mingw_fprintf fprintf
#define __mingw_vfprintf vfprintf #define __mingw_vfprintf vfprintf
#endif #endif
@ -82,13 +82,11 @@ __declspec(dllimport) void __cdecl __setusermatherr(int (__cdecl *)(struct _exce
#define _tm_unicode_safe(i) (_pioinfo_safe(i)->unicode) #define _tm_unicode_safe(i) (_pioinfo_safe(i)->unicode)
#ifndef __badioinfo #ifndef __badioinfo
extern ioinfo ** __MINGW_IMP_SYMBOL(__badioinfo)[]; _CRTIMP extern ioinfo * __badioinfo[];
#define __badioinfo (* __MINGW_IMP_SYMBOL(__badioinfo))
#endif #endif
#ifndef __pioinfo #ifndef __pioinfo
extern ioinfo ** __MINGW_IMP_SYMBOL(__pioinfo)[]; _CRTIMP extern ioinfo ** __pioinfo[];
#define __pioinfo (* __MINGW_IMP_SYMBOL(__pioinfo))
#endif #endif
#define _NO_CONSOLE_FILENO (intptr_t)-2 #define _NO_CONSOLE_FILENO (intptr_t)-2
@ -119,27 +117,10 @@ __declspec(dllimport) void __cdecl __setusermatherr(int (__cdecl *)(struct _exce
extern int _dowildcard; extern int _dowildcard;
extern int _newmode; extern int _newmode;
#ifndef __winitenv _CRTIMP extern wchar_t ** __winitenv;
extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv); _CRTIMP extern char ** __initenv;
#define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv)) _CRTIMP extern char * _acmdln;
#endif _CRTIMP extern char * _wcmdln;
#ifndef __initenv
extern char *** __MINGW_IMP_SYMBOL(__initenv);
#define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
#endif
#ifndef _acmdln
extern char ** __MINGW_IMP_SYMBOL(_acmdln);
#define _acmdln (* __MINGW_IMP_SYMBOL(_acmdln))
/* _CRTIMP extern char *_acmdln; */
#endif
#ifndef _wcmdln
extern char ** __MINGW_IMP_SYMBOL(_wcmdln);
#define _wcmdln (* __MINGW_IMP_SYMBOL(_wcmdln))
/* __CRTIMP extern wchar_t *_wcmdln; */
#endif
_CRTIMP __declspec(noreturn) void __cdecl _amsg_exit(int); _CRTIMP __declspec(noreturn) void __cdecl _amsg_exit(int);

View file

@ -7,7 +7,7 @@
#include <sect_attribs.h> #include <sect_attribs.h>
#include <internal.h> #include <internal.h>
__declspec(dllimport) int __cdecl __lconv_init (void); _CRTIMP int __cdecl __lconv_init (void);
int mingw_initcharmax = 0; int mingw_initcharmax = 0;

View file

@ -4,11 +4,6 @@
* No warranty is given; refer to the file DISCLAIMER.PD within this package. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/ */
#undef CRTDLL
#ifndef _DLL
#define _DLL
#endif
#define SPECIAL_CRTEXE #define SPECIAL_CRTEXE
#include <oscalls.h> #include <oscalls.h>
@ -25,19 +20,9 @@
#endif #endif
/* Special handling for ARM & ARM64, __winitenv & __initenv aren't present there. */ /* Special handling for ARM & ARM64, __winitenv & __initenv aren't present there. */
#if !defined(__arm__) && !defined(__aarch64__) #if !defined(__arm__) && !defined(__aarch64__)
_CRTIMP extern wchar_t** __winitenv;
#ifndef __winitenv _CRTIMP extern char** __initenv;
extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
#define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv))
#endif
#ifndef __initenv
extern char *** __MINGW_IMP_SYMBOL(__initenv);
#define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
#endif
#endif #endif
/* Hack, for bug in ld. Will be removed soon. */ /* Hack, for bug in ld. Will be removed soon. */