Bugfix for linux port

git-svn-id: svn://kolibrios.org@7545 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
tsdima
2018-11-09 18:21:10 +00:00
parent 60e27afe74
commit 490fec6653
4 changed files with 17 additions and 48 deletions

View File

@@ -222,45 +222,6 @@ int MakePE();
int MakeObj(); int MakeObj();
void CheckUndefClassProc(); void CheckUndefClassProc();
/*
PAVEL YAKOV
char* strupr(char* s)
{
char* p = s;
while (*p = toupper(*p)) p++;
return s;
}
char* strlwr(char* s)
{
char* p = s;
while (*p = tolower(*p)) p++;
return s;
}
int strnicmp(const char* s1, const char* s2, int len)
{
unsigned char c1,c2;
if(!len)
return 0;
do{
c1 = *s1++;
c2 = *s2++;
if (!c1||!c2)
break;
if (c1 == c2)
continue;
c1 = tolower(c1);
c2 = tolower(c2);
if (c1!=c2)
break;
} while (--len);
return (int)c1 - (int)c2;
}
*/
/* /*
void PrintTegList(structteg *tteg) void PrintTegList(structteg *tteg)
{ {
@@ -1175,6 +1136,9 @@ void * MALLOC (unsigned long size)
void *mem; void *mem;
mem=malloc(size); mem=malloc(size);
if(mem==NULL)OutMemory(); if(mem==NULL)OutMemory();
#ifdef _UNIX_
else memset(mem,0,size);
#endif
// if(((unsigned long)mem+size)>maxusedmem)maxusedmem=(unsigned long)mem+size; // if(((unsigned long)mem+size)>maxusedmem)maxusedmem=(unsigned long)mem+size;

View File

@@ -92,18 +92,17 @@ int MultiByteToWideChar(unsigned int,unsigned int,char*,int,wchar_t *,int);
#endif #endif
char* strupr(char* s);
char* strlwr(char* s);
int stricmp(const char*, const char*);
int strnicmp(const char*, const char*, int);
#ifdef _PORT_CPP_ #ifdef _PORT_CPP_
long lseek (int, long, int); long lseek (int, long, int);
char tolower(char c); char tolower(char c);
char toupper(char c); char toupper(char c);
char* strupr(char* s);
char* strlwr(char* s);
int stricmp(const char*, const char*);
int strnicmp(const char*, const char*, int);
char * getcwd (char *buffer, int size); char * getcwd (char *buffer, int size);
int stat (const char*, struct _stat*); int stat (const char*, struct _stat*);

View File

@@ -9081,7 +9081,7 @@ COM_MOD *bmod;
case tk_undefproc: case tk_undefproc:
case tk_declare: case tk_declare:
op66(r16); op66(r16);
op(0x50); //push AX op(0x50); //push AX
@@ -9136,7 +9136,7 @@ COM_MOD *bmod;
op(0x89); /* MOV CX,reg */ op(0x89); /* MOV CX,reg */
warningreg(regs[0][1]); warningreg(regs[0][1]);
op(0xC1+(unsigned int)itok.number*8); /* MOV instr */ op(0xC1+(unsigned int)itok.number*8); /* MOV instr */
@@ -9746,7 +9746,7 @@ newloop:
if(am32)idxregs[4]=255; if(am32)idxregs[4]=255;
doeaxfloatmath(tk_reg32,reg,rrettype==tk_float?0:4); doeaxfloatmath(tk_reg32,reg,rrettype==tk_float?0:4);
next=0; next=0;

View File

@@ -178,6 +178,9 @@ int hold;
for(int i=0;i<=numfindpath;i++){ for(int i=0;i<=numfindpath;i++){
sprintf((char *)string2,"%s%s",findpath[(firstflag==0?i:numfindpath-i)],filename); sprintf((char *)string2,"%s%s",findpath[(firstflag==0?i:numfindpath-i)],filename);
#ifndef _WIN32_
for(char* p=(char *)string2; *p; ++p) if(*p=='\\') *p='/';
#endif
if((hold=loadinputfile((char *)string2))!=-2)break; if((hold=loadinputfile((char *)string2))!=-2)break;
if(firstflag==2||(firstflag==0&&(i+1)==numfindpath))break; if(firstflag==2||(firstflag==0&&(i+1)==numfindpath))break;
} }
@@ -8600,6 +8603,9 @@ long filesize;
stringexpected(); stringexpected();
return(0); return(0);
} }
#ifndef _WIN32_
for(char* p=(char *)string3; *p; ++p) if(*p=='\\') *p='/';
#endif
filehandle=open((char *)string3,O_BINARY|O_RDONLY); filehandle=open((char *)string3,O_BINARY|O_RDONLY);
if(filehandle==-1){ if(filehandle==-1){
unableopenfile((char *)string3); unableopenfile((char *)string3);