mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 20:50:29 +00:00
ScoTTie <scott@wizzer-it.com>/erie-- <seditaniedi@gmail.com>
Build fixes for FreeBSD svn path=/trunk/; revision=18952
This commit is contained in:
parent
eb90b6c916
commit
02d236693b
15 changed files with 114 additions and 51 deletions
|
@ -71,13 +71,19 @@ unsigned long long
|
||||||
filelen ( FILE* f )
|
filelen ( FILE* f )
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
return _filelengthi64 ( _fileno(f) );
|
return _filelengthi64 ( _fileno(f) );
|
||||||
#else
|
#else
|
||||||
struct stat64 file_stat;
|
# ifdef __FreeBSD__
|
||||||
if ( fstat64(fileno(f), &file_stat) != 0 )
|
struct stat file_stat;
|
||||||
return 0;
|
if ( fstat(fileno(f), &file_stat) != 0 )
|
||||||
return file_stat.st_size;
|
# else
|
||||||
#endif
|
struct stat64 file_stat;
|
||||||
|
if ( fstat64(fileno(f), &file_stat) != 0 )
|
||||||
|
# endif // __FreeBSD__
|
||||||
|
return 0;
|
||||||
|
return file_stat.st_size;
|
||||||
|
|
||||||
|
#endif // WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
Path::Path()
|
Path::Path()
|
||||||
|
|
|
@ -2,12 +2,23 @@
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
#include <malloc.h>
|
#ifdef __FreeBSD__
|
||||||
|
# include <stdlib.h>
|
||||||
|
#else
|
||||||
|
# include <malloc.h>
|
||||||
|
#endif // __FreeBSD__
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "ssprintf.h"
|
#include "ssprintf.h"
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
# define __isnan isnan
|
||||||
|
# define __finite finite
|
||||||
|
# define powl __builtin_powl
|
||||||
|
# define modfl __builtin_modfl
|
||||||
|
#endif // _FreeBSD__
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define alloca _alloca
|
#define alloca _alloca
|
||||||
#endif//_MSC_VER
|
#endif//_MSC_VER
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
# include <sys/stat.h>
|
||||||
|
#endif // __FreeBSD__
|
||||||
#include "cabinet.h"
|
#include "cabinet.h"
|
||||||
#include "raw.h"
|
#include "raw.h"
|
||||||
#include "mszip.h"
|
#include "mszip.h"
|
||||||
|
|
|
@ -35,15 +35,19 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <io.h>
|
# include <io.h>
|
||||||
#include <dos.h>
|
# include <dos.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/io.h>
|
# ifdef __FreeBSD__
|
||||||
#include <errno.h>
|
# include <sys/uio.h>
|
||||||
#include <sys/types.h>
|
# else
|
||||||
#include <dirent.h>
|
# include <sys/io.h>
|
||||||
#include <unistd.h>
|
# endif // __FreeBSD__
|
||||||
#endif
|
# include <errno.h>
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <dirent.h>
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif // WIN32
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <malloc.h>
|
#ifndef __FreeBSD__
|
||||||
|
# include <malloc.h>
|
||||||
|
#endif // __FreeBSD__
|
||||||
|
|
||||||
/* DEFINES ****************************************************************/
|
/* DEFINES ****************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ typedef int LONG;
|
||||||
#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((unsigned long)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
|
#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((unsigned long)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
|
||||||
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0
|
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0
|
||||||
|
|
||||||
#pragma pack(push,2)
|
#pragma pack(2)
|
||||||
typedef struct _IMAGE_DOS_HEADER {
|
typedef struct _IMAGE_DOS_HEADER {
|
||||||
WORD e_magic;
|
WORD e_magic;
|
||||||
WORD e_cblp;
|
WORD e_cblp;
|
||||||
|
@ -69,8 +69,8 @@ typedef struct _IMAGE_DOS_HEADER {
|
||||||
WORD e_res2[10];
|
WORD e_res2[10];
|
||||||
LONG e_lfanew;
|
LONG e_lfanew;
|
||||||
} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER;
|
} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER;
|
||||||
#pragma pack(pop)
|
#pragma pack(4)
|
||||||
#pragma pack(push,4)
|
#pragma pack(4)
|
||||||
typedef struct _IMAGE_EXPORT_DIRECTORY {
|
typedef struct _IMAGE_EXPORT_DIRECTORY {
|
||||||
DWORD Characteristics;
|
DWORD Characteristics;
|
||||||
DWORD TimeDateStamp;
|
DWORD TimeDateStamp;
|
||||||
|
@ -150,7 +150,7 @@ typedef struct _IMAGE_SECTION_HEADER {
|
||||||
WORD NumberOfLinenumbers;
|
WORD NumberOfLinenumbers;
|
||||||
DWORD Characteristics;
|
DWORD Characteristics;
|
||||||
} IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER;
|
} IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER;
|
||||||
#pragma pack(pop)
|
#pragma pack(4)
|
||||||
|
|
||||||
/* End of ripped definitions */
|
/* End of ripped definitions */
|
||||||
|
|
||||||
|
|
|
@ -70,13 +70,19 @@ unsigned long long
|
||||||
filelen ( FILE* f )
|
filelen ( FILE* f )
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
return _filelengthi64 ( _fileno(f) );
|
return _filelengthi64 ( _fileno(f) );
|
||||||
#else
|
#else
|
||||||
struct stat64 file_stat;
|
# ifdef __FreeBSD__
|
||||||
if ( fstat64(fileno(f), &file_stat) != 0 )
|
struct stat file_stat;
|
||||||
return 0;
|
if ( fstat(fileno(f), &file_stat) != 0 )
|
||||||
return file_stat.st_size;
|
# else
|
||||||
#endif
|
struct stat64 file_stat;
|
||||||
|
if ( fstat64(fileno(f), &file_stat) != 0 )
|
||||||
|
# endif // __FreeBSD__
|
||||||
|
return 0;
|
||||||
|
return file_stat.st_size;
|
||||||
|
|
||||||
|
#endif // WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
Path::Path()
|
Path::Path()
|
||||||
|
|
|
@ -15,12 +15,23 @@
|
||||||
*/
|
*/
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
#include <malloc.h>
|
#ifdef __FreeBSD__
|
||||||
|
# include <stdlib.h>
|
||||||
|
#else
|
||||||
|
# include <malloc.h>
|
||||||
|
#endif // __FreeBSD__
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "ssprintf.h"
|
#include "ssprintf.h"
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
# define __isnan isnan
|
||||||
|
# define __finite finite
|
||||||
|
# define powl __builtin_powl
|
||||||
|
# define modfl __builtin_modfl
|
||||||
|
#endif // _FreeBSD__
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define alloca _alloca
|
#define alloca _alloca
|
||||||
#endif//_MSC_VER
|
#endif//_MSC_VER
|
||||||
|
|
|
@ -33,7 +33,7 @@ typedef unsigned long ULONG_PTR;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma pack(push,2)
|
#pragma pack(2)
|
||||||
typedef struct _IMAGE_DOS_HEADER {
|
typedef struct _IMAGE_DOS_HEADER {
|
||||||
WORD e_magic;
|
WORD e_magic;
|
||||||
WORD e_cblp;
|
WORD e_cblp;
|
||||||
|
@ -55,13 +55,13 @@ typedef struct _IMAGE_DOS_HEADER {
|
||||||
WORD e_res2[10];
|
WORD e_res2[10];
|
||||||
LONG e_lfanew;
|
LONG e_lfanew;
|
||||||
} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER;
|
} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER;
|
||||||
#pragma pack(pop)
|
#pragma pack(4)
|
||||||
|
|
||||||
#define IMAGE_FILE_LINE_NUMS_STRIPPED 4
|
#define IMAGE_FILE_LINE_NUMS_STRIPPED 4
|
||||||
#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 8
|
#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 8
|
||||||
#define IMAGE_FILE_DEBUG_STRIPPED 512
|
#define IMAGE_FILE_DEBUG_STRIPPED 512
|
||||||
|
|
||||||
#pragma pack(push,4)
|
#pragma pack(4)
|
||||||
typedef struct _IMAGE_FILE_HEADER {
|
typedef struct _IMAGE_FILE_HEADER {
|
||||||
WORD Machine;
|
WORD Machine;
|
||||||
WORD NumberOfSections;
|
WORD NumberOfSections;
|
||||||
|
@ -162,7 +162,7 @@ typedef struct {
|
||||||
USHORT s_nlnno; /* number of line number entries */
|
USHORT s_nlnno; /* number of line number entries */
|
||||||
ULONG s_flags; /* flags */
|
ULONG s_flags; /* flags */
|
||||||
} SCNHDR;
|
} SCNHDR;
|
||||||
#pragma pack(pop)
|
#pragma pack(4)
|
||||||
|
|
||||||
typedef struct _SYMBOLFILE_HEADER {
|
typedef struct _SYMBOLFILE_HEADER {
|
||||||
ULONG SymbolsOffset;
|
ULONG SymbolsOffset;
|
||||||
|
@ -238,7 +238,7 @@ typedef struct _STAB_ENTRY {
|
||||||
#define C_ALIAS 105 /* duplicate tag */
|
#define C_ALIAS 105 /* duplicate tag */
|
||||||
#define C_HIDDEN 106 /* ext symbol in dmert public lib */
|
#define C_HIDDEN 106 /* ext symbol in dmert public lib */
|
||||||
|
|
||||||
#pragma pack(push,1)
|
#pragma pack(1)
|
||||||
typedef struct _COFF_SYMENT
|
typedef struct _COFF_SYMENT
|
||||||
{
|
{
|
||||||
union
|
union
|
||||||
|
@ -258,7 +258,7 @@ typedef struct _COFF_SYMENT
|
||||||
UCHAR e_sclass;
|
UCHAR e_sclass;
|
||||||
UCHAR e_numaux;
|
UCHAR e_numaux;
|
||||||
} COFF_SYMENT, *PCOFF_SYMENT;
|
} COFF_SYMENT, *PCOFF_SYMENT;
|
||||||
#pragma pack(pop)
|
#pragma pack(4)
|
||||||
|
|
||||||
typedef struct _ROSSYM_ENTRY {
|
typedef struct _ROSSYM_ENTRY {
|
||||||
ULONG_PTR Address;
|
ULONG_PTR Address;
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
#ifndef RC_INVOKED
|
#ifndef RC_INVOKED
|
||||||
#pragma pack(pop)
|
# if ( __FreeBSD__ == 5 )
|
||||||
#endif
|
# pragma pack(4)
|
||||||
|
# else
|
||||||
|
# pragma pack(pop)
|
||||||
|
# endif // __FreeBSD__
|
||||||
|
#endif // RC_INVOKED
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
#ifndef RC_INVOKED
|
#ifndef RC_INVOKED
|
||||||
#pragma pack(push,1)
|
# if ( __FreeBSD__ == 5 )
|
||||||
#endif
|
# pragma pack(1)
|
||||||
|
# else
|
||||||
|
# pragma pack(push,1)
|
||||||
|
# endif // __FreeBSD__
|
||||||
|
#endif // RC_INVOKED
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
#ifndef RC_INVOKED
|
#ifndef RC_INVOKED
|
||||||
#pragma pack(push,2)
|
# if ( __FreeBSD__ == 5 )
|
||||||
#endif
|
# pragma pack(2)
|
||||||
|
# else
|
||||||
|
# pragma pack(push,2)
|
||||||
|
# endif // __FreeBSD__
|
||||||
|
#endif // RC_INVOKED
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
#ifndef RC_INVOKED
|
#ifndef RC_INVOKED
|
||||||
#pragma pack(push,4)
|
# if ( __FreeBSD__ == 5 )
|
||||||
#endif
|
# pragma pack(4)
|
||||||
|
# else
|
||||||
|
# pragma pack(push,4)
|
||||||
|
# endif // __FreeBSD__
|
||||||
|
#endif // RC_INVOKED
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
#ifndef RC_INVOKED
|
#ifndef RC_INVOKED
|
||||||
#pragma pack(push,8)
|
# if ( __FreeBSD__ == 5 )
|
||||||
#endif
|
# pragma pack(8)
|
||||||
|
# else
|
||||||
|
# pragma pack(push,8)
|
||||||
|
# endif // __FreeBSD__
|
||||||
|
#endif // RC_INVOKED
|
||||||
|
|
|
@ -1225,14 +1225,14 @@ typedef struct tagBITMAPCOREHEADER {
|
||||||
WORD bcPlanes;
|
WORD bcPlanes;
|
||||||
WORD bcBitCount;
|
WORD bcBitCount;
|
||||||
} BITMAPCOREHEADER,*LPBITMAPCOREHEADER,*PBITMAPCOREHEADER;
|
} BITMAPCOREHEADER,*LPBITMAPCOREHEADER,*PBITMAPCOREHEADER;
|
||||||
#pragma pack(push,1)
|
#include "pshpack1.h"
|
||||||
typedef struct tagRGBTRIPLE {
|
typedef struct tagRGBTRIPLE {
|
||||||
BYTE rgbtBlue;
|
BYTE rgbtBlue;
|
||||||
BYTE rgbtGreen;
|
BYTE rgbtGreen;
|
||||||
BYTE rgbtRed;
|
BYTE rgbtRed;
|
||||||
} RGBTRIPLE,*LPRGBTRIPLE;
|
} RGBTRIPLE,*LPRGBTRIPLE;
|
||||||
#pragma pack(pop)
|
#include "poppack.h"
|
||||||
#pragma pack(push,2)
|
#include "pshpack2.h"
|
||||||
typedef struct tagBITMAPFILEHEADER {
|
typedef struct tagBITMAPFILEHEADER {
|
||||||
WORD bfType;
|
WORD bfType;
|
||||||
DWORD bfSize;
|
DWORD bfSize;
|
||||||
|
@ -1240,7 +1240,7 @@ typedef struct tagBITMAPFILEHEADER {
|
||||||
WORD bfReserved2;
|
WORD bfReserved2;
|
||||||
DWORD bfOffBits;
|
DWORD bfOffBits;
|
||||||
} BITMAPFILEHEADER,*LPBITMAPFILEHEADER,*PBITMAPFILEHEADER;
|
} BITMAPFILEHEADER,*LPBITMAPFILEHEADER,*PBITMAPFILEHEADER;
|
||||||
#pragma pack(pop)
|
#include "poppack.h"
|
||||||
typedef struct _BITMAPCOREINFO {
|
typedef struct _BITMAPCOREINFO {
|
||||||
BITMAPCOREHEADER bmciHeader;
|
BITMAPCOREHEADER bmciHeader;
|
||||||
RGBTRIPLE bmciColors[1];
|
RGBTRIPLE bmciColors[1];
|
||||||
|
@ -2024,7 +2024,7 @@ typedef struct tagEMRSELECTCLIPPATH {
|
||||||
EMR emr;
|
EMR emr;
|
||||||
DWORD iMode;
|
DWORD iMode;
|
||||||
} EMRSELECTCLIPPATH,*PEMRSELECTCLIPPATH,EMRSETBKMODE,*PEMRSETBKMODE,EMRSETMAPMODE,*PEMRSETMAPMODE,EMRSETPOLYFILLMODE,*PEMRSETPOLYFILLMODE,EMRSETROP2,*PEMRSETROP2,EMRSETSTRETCHBLTMODE,*PEMRSETSTRETCHBLTMODE,EMRSETTEXTALIGN,*PEMRSETTEXTALIGN,EMRENABLEICM,*PEMRENABLEICM;
|
} EMRSELECTCLIPPATH,*PEMRSELECTCLIPPATH,EMRSETBKMODE,*PEMRSETBKMODE,EMRSETMAPMODE,*PEMRSETMAPMODE,EMRSETPOLYFILLMODE,*PEMRSETPOLYFILLMODE,EMRSETROP2,*PEMRSETROP2,EMRSETSTRETCHBLTMODE,*PEMRSETSTRETCHBLTMODE,EMRSETTEXTALIGN,*PEMRSETTEXTALIGN,EMRENABLEICM,*PEMRENABLEICM;
|
||||||
#pragma pack(push,2)
|
#include "pshpack2.h"
|
||||||
typedef struct tagMETAHEADER {
|
typedef struct tagMETAHEADER {
|
||||||
WORD mtType;
|
WORD mtType;
|
||||||
WORD mtHeaderSize;
|
WORD mtHeaderSize;
|
||||||
|
@ -2034,7 +2034,7 @@ typedef struct tagMETAHEADER {
|
||||||
DWORD mtMaxRecord;
|
DWORD mtMaxRecord;
|
||||||
WORD mtNoParameters;
|
WORD mtNoParameters;
|
||||||
} METAHEADER,*PMETAHEADER,*LPMETAHEADER;
|
} METAHEADER,*PMETAHEADER,*LPMETAHEADER;
|
||||||
#pragma pack(pop)
|
#include "poppack.h"
|
||||||
typedef struct tagENHMETAHEADER {
|
typedef struct tagENHMETAHEADER {
|
||||||
DWORD iType;
|
DWORD iType;
|
||||||
DWORD nSize;
|
DWORD nSize;
|
||||||
|
@ -2320,7 +2320,7 @@ typedef struct tagLOCALESIGNATURE {
|
||||||
DWORD lsCsbSupported[2];
|
DWORD lsCsbSupported[2];
|
||||||
} LOCALESIGNATURE,*PLOCALESIGNATURE,*LPLOCALESIGNATURE;
|
} LOCALESIGNATURE,*PLOCALESIGNATURE,*LPLOCALESIGNATURE;
|
||||||
typedef LONG LCSTYPE;
|
typedef LONG LCSTYPE;
|
||||||
#pragma pack(push,4)
|
#include "pshpack4.h"
|
||||||
typedef struct tagNEWTEXTMETRICA {
|
typedef struct tagNEWTEXTMETRICA {
|
||||||
LONG tmHeight;
|
LONG tmHeight;
|
||||||
LONG tmAscent;
|
LONG tmAscent;
|
||||||
|
@ -2373,7 +2373,7 @@ typedef struct tagNEWTEXTMETRICW {
|
||||||
UINT ntmCellHeight;
|
UINT ntmCellHeight;
|
||||||
UINT ntmAvgWidth;
|
UINT ntmAvgWidth;
|
||||||
} NEWTEXTMETRICW,*PNEWTEXTMETRICW,*LPNEWTEXTMETRICW;
|
} NEWTEXTMETRICW,*PNEWTEXTMETRICW,*LPNEWTEXTMETRICW;
|
||||||
#pragma pack(pop)
|
#include "poppack.h"
|
||||||
typedef struct tagNEWTEXTMETRICEXA {
|
typedef struct tagNEWTEXTMETRICEXA {
|
||||||
NEWTEXTMETRICA ntmTm;
|
NEWTEXTMETRICA ntmTm;
|
||||||
FONTSIGNATURE ntmFontSig;
|
FONTSIGNATURE ntmFontSig;
|
||||||
|
|
Loading…
Reference in a new issue