Skip to content

Commit

Permalink
DOSVGA failed on some Watcom compiles due to conflicting definitions …
Browse files Browse the repository at this point in the history
…of _FP_SEG and _FP_OFF. 'ripoff' now builds correctly on Digital Mars.
  • Loading branch information
Bill-Gray committed Jul 16, 2024
1 parent d22725b commit 981893b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 10 additions & 3 deletions dosvga/pdcdos.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ extern void PDC_private_cursor_on(int row, int col);
# else
# define _FAR_POINTER(s,o) (0xe0000000 + (((int)(s)) << 4) + ((int)(o)))
# endif
# define _FP_SEG(p) (unsigned short)((((long)p) >> 4) & 0xffff)
# ifndef __WATCOMC__
# define _FP_SEG(p) (unsigned short)((((long)p) >> 4) & 0xffff)
# endif
#else
# ifdef __TURBOC__
# define _FAR_POINTER(s,o) MK_FP(s,o)
Expand All @@ -119,9 +121,14 @@ extern void PDC_private_cursor_on(int row, int col);
# define _FAR_POINTER(s,o) (((long)s << 16) | (long)o)
# endif
# endif
# define _FP_SEG(p) (unsigned short)(((long)p) >> 4)
# ifndef __WATCOMC__
# define _FP_SEG(p) (unsigned short)(((long)p) >> 4)
# endif
#endif

#ifndef __WATCOMC__
# define _FP_OFF(p) ((unsigned short)p & 0x000f)
#endif
#define _FP_OFF(p) ((unsigned short)p & 0x000f)

#ifdef __DJGPP__
# include <sys/movedata.h>
Expand Down
4 changes: 4 additions & 0 deletions tests/ripoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ of this works very well in PDCurses.) */

#include <curses.h>

#ifdef __DMC__
#define snprintf _snprintf
#endif

int ripoff_callback( WINDOW *win, int width)
{
char buff[100];
Expand Down

0 comments on commit 981893b

Please sign in to comment.