tcc lib fix coffload, fwrite

git-svn-id: svn://kolibrios.org@7418 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl 2018-09-25 11:52:22 +00:00
parent be75d694bc
commit 6642abcbb2
3 changed files with 12 additions and 6 deletions

View File

@ -28,12 +28,14 @@ pause
goto :eof
:Compile_C
echo compile .c %1
%CC% %CFLAGS% %1 -o "%~dpn1.o"
if not %errorlevel%==0 goto Error_Failed
set objs=%objs% "%~dpn1.o"
goto :eof
:Compile_Asm
echo compile .asm %1
%ASM% %1 "%~dpn1.o"
if not %errorlevel%==0 goto Error_Failed
set objs=%objs% "%~dpn1.o"
@ -50,6 +52,7 @@ goto :Exit_OK
for %%f in ("%%a\*.asm") do call :Compile_Asm "%%f"
for %%f in ("%%a\*.c") do call :Compile_C "%%f"
)
echo calling AR
%AR% -ru %LIBNAME% %objs%
if not %errorlevel%==0 goto Error_Failed
goto Exit_OK

View File

@ -31,8 +31,9 @@ proc _ksys_cofflib_getproc stdcall, export:dword,name:dword
xor eax,eax
mov al,[ecx]
test al,al
jz exit_check_simbol
; siemargl moved to post-check
; test al,al
; jz exit_check_simbol
xor edx,edx
mov dl,[esi]
@ -41,6 +42,8 @@ proc _ksys_cofflib_getproc stdcall, export:dword,name:dword
add edi,1
jmp exit_check_simbol
simbols_equvalent:
test al,al
jz exit_check_simbol
;pushad

View File

@ -1,6 +1,8 @@
#include <stdio.h>
#include <kolibrisys.h>
// dont support return partial writing when fail
// only 32-bit filesize
int fwrite(void *buffer,int size,int count,FILE* file)
{
dword res;
@ -56,8 +58,7 @@ int fwrite(void *buffer,int size,int count,FILE* file)
if (res==0)
{
file->filepos+=fullsize;
fullsize=fullsize/count;
return(fullsize);
return(count);
} else
{
errno = -res;
@ -70,8 +71,7 @@ int fwrite(void *buffer,int size,int count,FILE* file)
if (res==0)
{
file->filepos+=fullsize;
fullsize=fullsize/count;
return(fullsize);
return(count);
} else
{
errno = -res;