Skip to content

Commit

Permalink
Supplement: Fixup some more compat prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbird authored and PerditionC committed Aug 31, 2022
1 parent 83fd61d commit 5f018a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions suppl/fmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ void far *_fmemset(void far * const dst, int ch, unsigned length);

unsigned _fstrlen(const char far * const s);
char far *_fstrchr(const char far * const s, int ch);
char far *_fmemchr(const char far * const s, int ch, unsigned length);
void far *_fmemchr(const void far * s, int ch, unsigned length);
void far *_fmemmove(void far * const dst, const void far * const src, unsigned length);
int _fmemcmp(const void far * const dst, const void far * const src, unsigned length);
int _fmemicmp(const void far * const dst, const void far * const src, unsigned length);
int _fstrcmp(const char far * const dst, const char far * const src);
int _fstricmp(const char far * const dst, const char far * const src);
void _fstrcpy(char far * const dst, const char far * const src);
char far *_fstrcpy(char far * dst, const char far * src);

#endif /* defined(_PAC_NOCLIB_) || defined(_TC_EARLY_) || defined(__GNUC__) */
#endif /* _TC_LATER_ */
Expand Down
4 changes: 2 additions & 2 deletions suppl/src/fmemchr.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ unsigned _fmemchr(unsigned const seg, unsigned ofs, const unsigned value, unsign
#include <portable.h>
#include "fmemory.h"

char far *_fmemchr(const char far* const s, int ch, unsigned length)
void far *_fmemchr(const void far * s, int ch, unsigned length)
{ const byte far *p;

for(p = (const byte far*)s; length--; ++p)
if(*p == ch)
return (char far*)p;
return (void far*)p;

return 0;
}
Expand Down
5 changes: 3 additions & 2 deletions suppl/src/fstrcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ co(mpilers): Micro-C only
#include "fmemory.loc"

#ifdef COMPILE
void _fstrcpy(fargDecl(char, dst), fargDecl(const char, src))
{ _fmemcpy(fargPass(dst), fargPass(src), _fstrlen1(src));
char far *_fstrcpy(fargDecl(char, dst), fargDecl(const char, src))
{
return (char far *)_fmemcpy(fargPass(dst), fargPass(src), _fstrlen1(src));
}
#endif

2 comments on commit 5f018a4

@ryojiang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Turbo C 2.01 to build FreeCOM will have below error message showing:

d:\tc201\TCC -I.. -c fstrcpy.c

Turbo C Version 2.01 Copyright (c) 1987, 1988 Borland International
fstrcpy.c:
Error fstrcpy.c 44: Type mismatch in redeclaration of '_fstrcpy'
*** 1 errors in Compile ***

--> I rolled fmemory.h and fstrcpy.c back to 2021-07-11 released source code, and does not see this issue.

@andrewbird
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the report, I've reverted that commit and fixed the original problem in a way that shouldn't affect TurboC

Please sign in to comment.