mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-30 17:24:25 +02:00
Allow compilation with gcc (non-working result); define size_t.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@405 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
a1c16f81bd
commit
0b5ac953f0
36
hdr/portab.h
36
hdr/portab.h
@ -91,15 +91,15 @@ void __int__(int);
|
|||||||
|
|
||||||
#define MC68K
|
#define MC68K
|
||||||
|
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
/* for warnings only ! */
|
||||||
|
#define MC68K
|
||||||
|
|
||||||
#else
|
#else
|
||||||
anyone knows a _portable_ way to create nice errors ? ?
|
anyone knows a _portable_ way to create nice errors ? ?
|
||||||
at least this causes the compiler not to compile : -)
|
at least this causes the compiler not to compile : -)
|
||||||
#endif
|
#endif
|
||||||
/* functions, that are shared between C and ASM _must_
|
|
||||||
have a certain calling standard. These are declared
|
|
||||||
as 'ASMCFUNC', and is (and will be ?-) cdecl */
|
|
||||||
#define ASMCFUNC cdecl
|
|
||||||
#define ASM ASMCFUNC
|
|
||||||
#ifdef MC68K
|
#ifdef MC68K
|
||||||
#define far /* No far type */
|
#define far /* No far type */
|
||||||
#define interrupt /* No interrupt type */
|
#define interrupt /* No interrupt type */
|
||||||
@ -107,11 +107,19 @@ anyone knows a _portable_ way to create nice errors ? ?
|
|||||||
#define FAR /* linear architecture */
|
#define FAR /* linear architecture */
|
||||||
#define NEAR /* " " */
|
#define NEAR /* " " */
|
||||||
#define INRPT interrupt
|
#define INRPT interrupt
|
||||||
#define CONST
|
|
||||||
#define REG register
|
#define REG register
|
||||||
#define API int /* linear architecture */
|
#define API int /* linear architecture */
|
||||||
#define NONNATIVE
|
#define NONNATIVE
|
||||||
#define PARASIZE 4096 /* "paragraph" size */
|
#define PARASIZE 4096 /* "paragraph" size */
|
||||||
|
#define CDECL
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define CONST const
|
||||||
|
#define PROTO
|
||||||
|
typedef __SIZE_TYPE__ size_t;
|
||||||
|
#else
|
||||||
|
#define CONST
|
||||||
|
typedef unsigned size_t;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef I86
|
#ifdef I86
|
||||||
#define VOID void
|
#define VOID void
|
||||||
@ -123,7 +131,13 @@ anyone knows a _portable_ way to create nice errors ? ?
|
|||||||
#define API int far pascal /* segment architecture */
|
#define API int far pascal /* segment architecture */
|
||||||
#define NATIVE
|
#define NATIVE
|
||||||
#define PARASIZE 16 /* "paragraph" size */
|
#define PARASIZE 16 /* "paragraph" size */
|
||||||
|
typedef unsigned size_t;
|
||||||
#endif
|
#endif
|
||||||
|
/* functions, that are shared between C and ASM _must_
|
||||||
|
have a certain calling standard. These are declared
|
||||||
|
as 'ASMCFUNC', and is (and will be ?-) cdecl */
|
||||||
|
#define ASMCFUNC CDECL
|
||||||
|
#define ASM ASMCFUNC
|
||||||
/* */
|
/* */
|
||||||
/* Boolean type & definitions of TRUE and FALSE boolean values */
|
/* Boolean type & definitions of TRUE and FALSE boolean values */
|
||||||
/* */
|
/* */
|
||||||
@ -199,7 +213,7 @@ typedef signed long LONG;
|
|||||||
#ifdef __WATCOMC__
|
#ifdef __WATCOMC__
|
||||||
#define MK_FP(seg,ofs) (((UWORD)(seg)):>((VOID *)(ofs)))
|
#define MK_FP(seg,ofs) (((UWORD)(seg)):>((VOID *)(ofs)))
|
||||||
#else
|
#else
|
||||||
#define MK_FP(seg,ofs) ((VOID far *)(((ULONG)(seg)<<16)|(UWORD)(ofs)))
|
#define MK_FP(seg,ofs) ((void FAR *)(((ULONG)(seg)<<16)|(UWORD)(ofs)))
|
||||||
#endif
|
#endif
|
||||||
#define FP_SEG(fp) ((unsigned)(UWORD)((ULONG)(VOID FAR *)(fp)>>16))
|
#define FP_SEG(fp) ((unsigned)(UWORD)((ULONG)(VOID FAR *)(fp)>>16))
|
||||||
#define FP_OFF(fp) ((unsigned)(UWORD)(fp))
|
#define FP_OFF(fp) ((unsigned)(UWORD)(fp))
|
||||||
@ -207,12 +221,12 @@ typedef signed long LONG;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MC68K
|
#ifdef MC68K
|
||||||
#define MK_FP(seg,ofs) ((VOID *)(&(((BYTE *)(seg))[(ofs)])))
|
#define MK_FP(seg,ofs) ((VOID *)(&(((BYTE *)(size_t)(seg))[(ofs)])))
|
||||||
#define FP_SEG(fp) (0)
|
#define FP_SEG(fp) (0)
|
||||||
#define FP_OFF(fp) (fp)
|
#define FP_OFF(fp) ((size_t)(fp))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef VOID (FAR ASMCFUNC * intvec) ();
|
typedef VOID (FAR ASMCFUNC * intvec) (void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
this suppresses the warning
|
this suppresses the warning
|
||||||
@ -222,6 +236,8 @@ typedef VOID (FAR ASMCFUNC * intvec) ();
|
|||||||
|
|
||||||
#if defined(__TURBOC__)
|
#if defined(__TURBOC__)
|
||||||
#define UNREFERENCED_PARAMETER(x) if (x);
|
#define UNREFERENCED_PARAMETER(x) if (x);
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#define UNREFERENCED_PARAMETER(x) x = 0;
|
||||||
#else
|
#else
|
||||||
#define UNREFERENCED_PARAMETER(x) x;
|
#define UNREFERENCED_PARAMETER(x) x;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user