make possible DLL CRT (declare CRT funcs as _CRTIMP)

This was SVN commit r481.
This commit is contained in:
janwas 2004-06-11 17:55:24 +00:00
parent 1887a82873
commit f9625ecd00
2 changed files with 30 additions and 8 deletions

View File

@ -238,11 +238,22 @@ typedef struct _SYSTEM_POWER_INFORMATION
#include "types.h" // intptr_t
/* Define _CRTIMP */
#ifndef _CRTIMP
#ifdef _DLL
#define _CRTIMP __declspec(dllimport)
#else /* ndef _DLL */
#define _CRTIMP
#endif /* _DLL */
#endif /* _CRTIMP */
extern "C" {
extern intptr_t _get_osfhandle(int);
extern int _open_osfhandle(intptr_t, int);
extern int _open(const char* fn, int mode, ...);
extern int _close(int);
_CRTIMP intptr_t _get_osfhandle(int);
_CRTIMP int _open_osfhandle(intptr_t, int);
_CRTIMP int _open(const char* fn, int mode, ...);
_CRTIMP int _close(int);
#ifndef NO_WINSOCK
extern __declspec(dllimport) int __stdcall WSAStartup(unsigned short, void*);

View File

@ -33,6 +33,17 @@ extern "C" {
#endif
/* Define _CRTIMP */
#ifndef _CRTIMP
#ifdef _DLL
#define _CRTIMP __declspec(dllimport)
#else /* ndef _DLL */
#define _CRTIMP
#endif /* _DLL */
#endif /* _CRTIMP */
//
// <inttypes.h>
//
@ -211,7 +222,7 @@ extern int munmap(void* start, size_t len);
#define O_NONBLOCK 0x1000000
extern int open(const char* fn, int mode, ...);
_CRTIMP int open(const char* fn, int mode, ...);
//
@ -229,12 +240,12 @@ extern int open(const char* fn, int mode, ...);
#define read _read
#define write _write
extern int close(int);
extern int access(const char*, int);
_CRTIMP int close(int);
_CRTIMP int access(const char*, int);
extern int chdir(const char*);
#define getcwd _getcwd
extern char* getcwd(char*, int);
_CRTIMP char* getcwd(char*, int);
// user tests if available via #ifdef; can't use enum.
#define _SC_PAGESIZE 1