some changes for an old borland compiler

This commit is contained in:
hyunghwan.chung 2018-10-30 06:02:36 +00:00
parent f3f77ae9f2
commit 1200203eba
5 changed files with 35 additions and 31 deletions

View File

@ -857,7 +857,7 @@ static int add_to_oow_pool (moo_t* moo, moo_oow_pool_t* pool, moo_oow_t v)
do { if (add_token_str(moo, s, l) <= -1) return -1; } while (0) do { if (add_token_str(moo, s, l) <= -1) return -1; } while (0)
#define ADD_TOKEN_CHAR(moo,c) \ #define ADD_TOKEN_CHAR(moo,c) \
do { if (add_token_char(moo, c) <= -1) return -1; } while (0) do { if (add_token_char(moo, (moo_ooch_t)c) <= -1) return -1; } while (0)
#define CLEAR_TOKEN_NAME(moo) ((moo)->c->tok.name.len = 0) #define CLEAR_TOKEN_NAME(moo) ((moo)->c->tok.name.len = 0)
#define SET_TOKEN_TYPE(moo,tv) ((moo)->c->tok.type = (tv)) #define SET_TOKEN_TYPE(moo,tv) ((moo)->c->tok.type = (tv))
@ -7279,7 +7279,7 @@ static int make_defined_class (moo_t* moo)
moo_cunit_class_t* cc = (moo_cunit_class_t*)moo->c->cunit; moo_cunit_class_t* cc = (moo_cunit_class_t*)moo->c->cunit;
moo_oop_t tmp; moo_oop_t tmp;
moo_oow_t spec, self_spec; moo_ooi_t spec, self_spec;
int just_made = 0, flags; int just_made = 0, flags;
flags = 0; flags = 0;

View File

@ -195,6 +195,7 @@ static const moo_ooch_t* synerr_to_errstr (moo_synerrnum_t errnum)
#if defined(_WIN32) #if defined(_WIN32)
# include <windows.h> # include <windows.h>
# include <errno.h>
#elif defined(__OS2__) #elif defined(__OS2__)
# define INCL_DOSPROCESS # define INCL_DOSPROCESS
# define INCL_DOSFILEMGR # define INCL_DOSFILEMGR

View File

@ -127,6 +127,8 @@ static MOO_INLINE const char* proc_state_to_string (int state)
# define __PRIMITIVE_NAME__ "<<primitive>>" # define __PRIMITIVE_NAME__ "<<primitive>>"
#elif defined(_SCO_DS) #elif defined(_SCO_DS)
# define __PRIMITIVE_NAME__ "<<primitive>>" # define __PRIMITIVE_NAME__ "<<primitive>>"
#elif defined(__BORLANDC__) && (__BORLANDC__ <= 0x520)
# define __PRIMITIVE_NAME__ "<<primitive>>"
#else #else
# define __PRIMITIVE_NAME__ (&__FUNCTION__[0]) # define __PRIMITIVE_NAME__ (&__FUNCTION__[0])
#endif #endif

View File

@ -1278,7 +1278,7 @@ static int _del_poll_fd (moo_t* moo, int fd)
ev.revents = 0; ev.revents = 0;
if (write (xtn->ep, &ev, MOO_SIZEOF(ev)) != MOO_SIZEOF(ev)) if (write (xtn->ep, &ev, MOO_SIZEOF(ev)) != MOO_SIZEOF(ev))
{ {
moo_syserr_to_errnum (errno); moo_seterrwithsyserr (moo, errno);
MOO_DEBUG2 (moo, "Cannot remove file descriptor %d from devpoll - %hs\n", fd, strerror(errno)); MOO_DEBUG2 (moo, "Cannot remove file descriptor %d from devpoll - %hs\n", fd, strerror(errno));
return -1; return -1;
} }
@ -1293,7 +1293,7 @@ static int _del_poll_fd (moo_t* moo, int fd)
memset (&ev, 0, MOO_SIZEOF(ev)); memset (&ev, 0, MOO_SIZEOF(ev));
if (epoll_ctl (xtn->ep, EPOLL_CTL_DEL, fd, &ev) == -1) if (epoll_ctl (xtn->ep, EPOLL_CTL_DEL, fd, &ev) == -1)
{ {
moo_syserr_to_errnum (errno); moo_seterrwithsyserr (moo, errno);
MOO_DEBUG2 (moo, "Cannot remove file descriptor %d from epoll - %hs\n", fd, strerror(errno)); MOO_DEBUG2 (moo, "Cannot remove file descriptor %d from epoll - %hs\n", fd, strerror(errno));
return -1; return -1;
} }
@ -1456,7 +1456,7 @@ static int vm_startup (moo_t* moo)
xtn->ep = open ("/dev/poll", O_RDWR); xtn->ep = open ("/dev/poll", O_RDWR);
if (xtn->ep == -1) if (xtn->ep == -1)
{ {
moo_syserr_to_errnum (errno); moo_seterrwithsyserr (moo, errno);
MOO_DEBUG1 (moo, "Cannot create devpoll - %hs\n", strerror(errno)); MOO_DEBUG1 (moo, "Cannot create devpoll - %hs\n", strerror(errno));
goto oops; goto oops;
} }
@ -1472,7 +1472,7 @@ static int vm_startup (moo_t* moo)
#endif #endif
if (xtn->ep == -1) if (xtn->ep == -1)
{ {
moo_syserr_to_errnum (errno); moo_seterrwithsyserr (moo, errno);
MOO_DEBUG1 (moo, "Cannot create epoll - %hs\n", strerror(errno)); MOO_DEBUG1 (moo, "Cannot create epoll - %hs\n", strerror(errno));
goto oops; goto oops;
} }
@ -1498,7 +1498,7 @@ static int vm_startup (moo_t* moo)
#if defined(USE_THREAD) #if defined(USE_THREAD)
if (pipe(xtn->p) == -1) if (pipe(xtn->p) == -1)
{ {
moo_syserr_to_errnum (errno); moo_seterrwithsyserr (moo, errno);
MOO_DEBUG1 (moo, "Cannot create pipes - %hs\n", strerror(errno)); MOO_DEBUG1 (moo, "Cannot create pipes - %hs\n", strerror(errno));
goto oops; goto oops;
} }

View File

@ -89,7 +89,8 @@ typedef struct _IO_STATUS_BLOCK
DWORD Status; DWORD Status;
PVOID Pointer; PVOID Pointer;
} u; } u;
ULONG_PTR Information; /*ULONG_PTR Information;*/
ULONG* Information;
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
typedef enum _FILE_INFORMATION_CLASS typedef enum _FILE_INFORMATION_CLASS