forked from KolibriOS/kolibrios
tcc lib fix coffload, fwrite
git-svn-id: svn://kolibrios.org@7418 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
be75d694bc
commit
6642abcbb2
@ -28,12 +28,14 @@ pause
|
|||||||
goto :eof
|
goto :eof
|
||||||
|
|
||||||
:Compile_C
|
:Compile_C
|
||||||
|
echo compile .c %1
|
||||||
%CC% %CFLAGS% %1 -o "%~dpn1.o"
|
%CC% %CFLAGS% %1 -o "%~dpn1.o"
|
||||||
if not %errorlevel%==0 goto Error_Failed
|
if not %errorlevel%==0 goto Error_Failed
|
||||||
set objs=%objs% "%~dpn1.o"
|
set objs=%objs% "%~dpn1.o"
|
||||||
goto :eof
|
goto :eof
|
||||||
|
|
||||||
:Compile_Asm
|
:Compile_Asm
|
||||||
|
echo compile .asm %1
|
||||||
%ASM% %1 "%~dpn1.o"
|
%ASM% %1 "%~dpn1.o"
|
||||||
if not %errorlevel%==0 goto Error_Failed
|
if not %errorlevel%==0 goto Error_Failed
|
||||||
set objs=%objs% "%~dpn1.o"
|
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\*.asm") do call :Compile_Asm "%%f"
|
||||||
for %%f in ("%%a\*.c") do call :Compile_C "%%f"
|
for %%f in ("%%a\*.c") do call :Compile_C "%%f"
|
||||||
)
|
)
|
||||||
|
echo calling AR
|
||||||
%AR% -ru %LIBNAME% %objs%
|
%AR% -ru %LIBNAME% %objs%
|
||||||
if not %errorlevel%==0 goto Error_Failed
|
if not %errorlevel%==0 goto Error_Failed
|
||||||
goto Exit_OK
|
goto Exit_OK
|
||||||
|
@ -31,8 +31,9 @@ proc _ksys_cofflib_getproc stdcall, export:dword,name:dword
|
|||||||
|
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov al,[ecx]
|
mov al,[ecx]
|
||||||
test al,al
|
; siemargl moved to post-check
|
||||||
jz exit_check_simbol
|
; test al,al
|
||||||
|
; jz exit_check_simbol
|
||||||
|
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
mov dl,[esi]
|
mov dl,[esi]
|
||||||
@ -41,6 +42,8 @@ proc _ksys_cofflib_getproc stdcall, export:dword,name:dword
|
|||||||
add edi,1
|
add edi,1
|
||||||
jmp exit_check_simbol
|
jmp exit_check_simbol
|
||||||
simbols_equvalent:
|
simbols_equvalent:
|
||||||
|
test al,al
|
||||||
|
jz exit_check_simbol
|
||||||
|
|
||||||
;pushad
|
;pushad
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <kolibrisys.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)
|
int fwrite(void *buffer,int size,int count,FILE* file)
|
||||||
{
|
{
|
||||||
dword res;
|
dword res;
|
||||||
@ -56,8 +58,7 @@ int fwrite(void *buffer,int size,int count,FILE* file)
|
|||||||
if (res==0)
|
if (res==0)
|
||||||
{
|
{
|
||||||
file->filepos+=fullsize;
|
file->filepos+=fullsize;
|
||||||
fullsize=fullsize/count;
|
return(count);
|
||||||
return(fullsize);
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
errno = -res;
|
errno = -res;
|
||||||
@ -70,8 +71,7 @@ int fwrite(void *buffer,int size,int count,FILE* file)
|
|||||||
if (res==0)
|
if (res==0)
|
||||||
{
|
{
|
||||||
file->filepos+=fullsize;
|
file->filepos+=fullsize;
|
||||||
fullsize=fullsize/count;
|
return(count);
|
||||||
return(fullsize);
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
errno = -res;
|
errno = -res;
|
||||||
|
Loading…
Reference in New Issue
Block a user