more msvc compile fixes by Brezenbak and I

svn path=/trunk/; revision=19515
This commit is contained in:
Steven Edwards 2005-11-24 06:07:04 +00:00
parent 192667e346
commit 59a50a6f88
21 changed files with 74 additions and 23 deletions

View file

@ -22,13 +22,13 @@
double _logb (double __x)
{
register double __value;
register double __val;
#ifdef __GNUC__
register double __junk;
__asm __volatile__
("fxtract\n\t"
: "=t" (__junk), "=u" (__value) : "0" (__x));
: "=t" (__junk), "=u" (__val) : "0" (__x));
#else
#endif /*__GNUC__*/
return __value;
return __val;
}

View file

@ -15,15 +15,16 @@
* here.
*
*/
#include_next<float.h>
#ifdef __GNUC__
#include_next <float.h>
#endif
#ifndef _MINGW_FLOAT_H_
#define _MINGW_FLOAT_H_
/* All the headers include this file. */
#include <_mingw.h>
#ifdef __GNUC__
#include <_mingw.h>
#endif
/*
* Functions and definitions for controlling the FPU.
*/
@ -90,12 +91,24 @@
#define _FPE_STACKUNDERFLOW 0x8b
#define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */
#define DBL_MAX_10_EXP 308
#define S_IFIFO -1
#define UINT64_MAX 0xffffffffffffffff
#ifndef RC_INVOKED
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _CRTIMP
#ifdef _DLL
#define _CRTIMP __declspec(dllimport)
#else
#define _CRTIMP
#endif /* _DLL */
#endif
/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
* i.e. change the bits in unMask to have the values they have in unNew,
* leaving other bits unchanged. */

View file

@ -16,6 +16,8 @@
#include <stdio.h>
#include <fcntl.h>
#include <stdarg.h>
#include <time.h>
#include <windef.h>
#include <winbase.h>

View file

@ -18,5 +18,20 @@
#endif
#define _P2 (_P_|__2)
#if defined (_MSC_VER)
#undef _ismbbkana
#undef _ismbbkpunct
#undef _ismbbalpha
#undef _ismbbalnum
#undef _ismbbgraph
#undef _ismbbkalnum
#undef _ismbblead
#undef _ismbbprint
#undef _ismbbpunct
#undef _ismbbtrail
#endif
#endif

View file

@ -20,7 +20,7 @@
int _taccess( const _TCHAR *_path, int _amode )
{
DWORD Attributes = GetFileAttributes(_path);
DPRINT(MK_STR(_taccess)"('%"_TS"', %x)\n", _path, _amode);
DPRINT(MK_STR(_taccess)"('%"sT"', %x)\n", _path, _amode);
if (Attributes == (DWORD)-1) {
_dosmaperr(GetLastError());
@ -44,7 +44,7 @@ int _taccess( const _TCHAR *_path, int _amode )
int access_dirT(const _TCHAR *_path)
{
DWORD Attributes = GetFileAttributes(_path);
DPRINT(MK_STR(is_dirT)"('%"_TS"')\n", _path);
DPRINT(MK_STR(is_dirT)"('%"sT"')\n", _path);
if (Attributes == (DWORD)-1) {
_dosmaperr(GetLastError());

View file

@ -20,7 +20,7 @@ int _tchmod(const _TCHAR* filename, mode_t mode)
DWORD FileAttributes = 0;
BOOLEAN Set = FALSE;
DPRINT(#_tchmod"('%"sT"', %x)\n", filename, mode);
DPRINT(MK_STR(_tchmod)"('%"sT"', %x)\n", filename, mode);
FileAttributes = GetFileAttributes(filename);
if ( FileAttributes == (DWORD)-1 ) {

View file

@ -2,7 +2,7 @@
#include <errno.h>
#include <io.h>
#include <stdio.h>
#include <sys/types.h>
/*
* @implemented

View file

@ -1,10 +1,10 @@
#include "precomp.h"
#include <stdio.h>
#include <io.h>
#include <errno.h>
#include <sys/utime.h>
#include <internal/file.h>
/*
* @implemented
*/
@ -23,3 +23,4 @@ int _wutime(const wchar_t* filename, struct _utimbuf* buf)
return -1;
return ret;
}

View file

@ -1,4 +1,7 @@
#define CRT_SECURE_NO_DEPRECATE
#define _INC_WTIME_INL
#define _INC_UTIME_INL
#define _INC_TIME_INL
#define WIN32_NO_STATUS
#include <windows.h>

View file

@ -9,7 +9,6 @@
*/
#include "precomp.h"
#include <process.h>
/*
* @implemented

View file

@ -8,7 +8,7 @@
void _default_handler(int signal);
//typedef void (*_p_sig_fn_t)(int);
typedef void (*__p_sig_fn_t)(int);
typedef struct _sig_element

View file

@ -29,6 +29,7 @@
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>
#include <fcntl.h>

View file

@ -23,3 +23,4 @@ fputwc(wchar_t c, FILE *fp)
return putwc(c,fp);
}

View file

@ -4,6 +4,7 @@
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <io.h>
#include <tchar.h>

View file

@ -14,6 +14,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <io.h>
#include <fcntl.h>
#include <share.h>

View file

@ -450,6 +450,7 @@ static int string(FILE *f, const char* s, int len, int field_width, int precisio
static int stringw(FILE *f, const wchar_t* sw, int len, int field_width, int precision, int flags)
{
int i, done = 0;
char * mb;
if (sw == NULL)
{
sw = L"<NULL>";
@ -476,10 +477,11 @@ static int stringw(FILE *f, const wchar_t* sw, int len, int field_width, int pre
return -1;
done++;
}
mb = malloc(MB_CUR_MAX * sizeof(char));
if(!mb)
return -1;
for (i = 0; i < len; ++i)
{
//#define MB_CUR_MAX 1
char mb[MB_CUR_MAX];
int mbcount, j;
mbcount = wctomb(mb, *sw++);
if (mbcount <= 0)
@ -489,16 +491,23 @@ static int stringw(FILE *f, const wchar_t* sw, int len, int field_width, int pre
for (j = 0; j < mbcount; j++)
{
if (putc(mb[j], f) == EOF)
{
free(mb);
return -1;
}
done++;
}
}
while (len < field_width--)
{
if (putc(' ', f) == EOF)
{
free(mb);
return -1;
}
done++;
}
free(mb);
return done;
}

View file

@ -7,7 +7,7 @@
#include <malloc.h>
#include <internal/file.h>
#include <ntdef.h>
#include <winnt.h>
int _isnanl(double x);
int _isinfl(double x);

View file

@ -17,7 +17,7 @@ void _tsearchenv(const _TCHAR* file,const _TCHAR* var,_TCHAR* path)
_TCHAR* y;
_TCHAR* FilePart;
DPRINT(#_tsearchenv"()\n");
DPRINT(MK_STR(_tsearchenv)"()\n");
x = _tcschr(env,'=');
if ( x != NULL ) {

View file

@ -8,19 +8,23 @@
#include <stdlib.h>
#include <internal/file.h>
#if defined (_MSC_VER)
#define UINT64_MAX 0xffffffffffffffff
#endif
/*
* Convert a string to an unsigned long integer.
*
* Ignores `locale' stuff. Assumes that the upper and lower case
* alphabets and digits are each contiguous.
*/
uint64_t
UINT64
strtoull(const char *nptr, char **endptr, int base)
{
const char *s = nptr;
uint64_t acc;
UINT64 acc;
int c;
uint64_t cutoff;
UINT64 cutoff;
int neg = 0, any, cutlim;
/*

View file

@ -73,7 +73,7 @@ int _fstat(int fd, struct _stat* statbuf)
else if (dwFileType == FILE_TYPE_PIPE)
{
statbuf->st_dev = fd;
statbuf->st_mode = S_IFIFO;
statbuf->st_mode = -1; //S_IFIFO;
}
else
{

View file

@ -1,4 +1,5 @@
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include "precomp.h"
#include <time.h>
/*