This patch documents the changes needed in djdev203 to resolve the name-clash
existing between the GNU gettext and the BORLAND-compatibility gettext function.
This patch should not be needed with djdev204 anymore.
Apply the patch running the command:
   patch -p1 < conio.diffs
from the top srcdir.
The GNU gettext function is declared in libintl.h and the BORLAND-compatibility
gettext function is declared in conio.h. To resolve this name-clash, the gettext
function from conio.h and conio.c has been renamed into _conio_gettext.
In conio.h, a macro gettext, that will expand into _conio_gettext, has been
introduced. This macro expansion will be supressed if libintl.h is included
by the same source file. In this case, the BORLAND-compatibility function will
only be available as _conio_gettext.

This has the following concequences for the user:
1) The user wants to use BORLAND-compatibility gettext from conio.h only.
   In this case the user must include conio.h in the source file and the
   gettext keyword makes *always* reference to BORLAND-compatibility gettext.
   There are no user visible changes at all.
2) The user wants to use GNU gettext from libintl.h only.
   In this case the user must include libintl.h in the source file and the
   gettext keyword makes *always* reference to GNU gettext.
   There are no user visible changes at all.
3) The user wants to use both gettext functions in the same source file.
   In this case both headers, libintl.h and conio.h, must be included in the
   source file and the keyword gettext makes **always** reference to
   GNU gettext and **never** to BORLAND-compatibility gettext.
   To use the BORLAND-compatibility gettext in this case the user must use
   the keyword: _conio_gettext instead of gettext.

Regards,
Guerrero, Juan Manuel


diff -acprNC5 djgpp.orig/include/conio.h djgpp/include/conio.h
*** djgpp.orig/include/conio.h	Sun Jul 12 18:16:24 1998
--- djgpp/include/conio.h	Sun Apr 22 01:11:06 2001
*************** enum COLORS {
*** 62,79 ****
  
  void    blinkvideo(void);
  char *  cgets(char *_str); 
  void    clreol(void);
  void    clrscr(void);
  int     _conio_kbhit(void); /* checks for ungetch char */
  int     cprintf(const char *_format, ...) __attribute__((format(printf,1,2)));
  int     cputs(const char *_str);
  int     cscanf(const char *_format, ...) __attribute__((format(scanf,1,2)));
  void    delline(void);
  int     getch(void);
  int     getche(void);
- int     gettext(int _left, int _top, int _right, int _bottom, void *_destin);
  void    gettextinfo(struct text_info *_r);
  void    gotoxy(int _x, int _y);
  void    gppconio_init(void);
  void    highvideo(void);
  void    insline(void);
--- 62,79 ----
  
  void    blinkvideo(void);
  char *  cgets(char *_str); 
  void    clreol(void);
  void    clrscr(void);
+ int     _conio_gettext(int _left, int _top, int _right, int _bottom, void *_destin);
  int     _conio_kbhit(void); /* checks for ungetch char */
  int     cprintf(const char *_format, ...) __attribute__((format(printf,1,2)));
  int     cputs(const char *_str);
  int     cscanf(const char *_format, ...) __attribute__((format(scanf,1,2)));
  void    delline(void);
  int     getch(void);
  int     getche(void);
  void    gettextinfo(struct text_info *_r);
  void    gotoxy(int _x, int _y);
  void    gppconio_init(void);
  void    highvideo(void);
  void    insline(void);
*************** void    window(int _left, int _top, int 
*** 96,105 ****
--- 96,118 ----
  
  #define kbhit _conio_kbhit /* Who ever includes gppconio.h probably
                                also wants _conio_kbhit and not kbhit
                                from libc */
  
+ /* This is to resolve the name clash between
+    gettext from conio.h and gettext from libintl.h.
+    IMPORTANT:
+    If both headers are included, the gettext keyword will always
+    make reference to the GNU gettext function declared in libintl.h
+    and never to the BORLAND-compatibility gettext function declared
+    in conio.h. In this case, BORLAND-compatibility gettext function
+    will only be available as _conio_gettext. */
+ #ifndef __USE_GNU_GETTEXT
+ # undef  gettext
+ # define gettext _conio_gettext
+ #endif
+ 
  #endif /* !_POSIX_SOURCE */
  #endif /* !__STRICT_ANSI__ */
  #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  
  #ifndef __dj_ENFORCE_FUNCTION_CALLS
diff -acprNC5 djgpp.orig/src/libc/pc_hw/co80/conio.c djgpp/src/libc/pc_hw/co80/conio.c
*** djgpp.orig/src/libc/pc_hw/co80/conio.c	Thu Jun  3 19:27:36 1999
--- djgpp/src/libc/pc_hw/co80/conio.c	Sun Apr 22 01:11:06 2001
*************** puttext(int c, int r, int c2, int r2, vo
*** 88,98 ****
    }
    return 1;
  }
  
  int
! gettext(int c, int r, int c2, int r2, void *buf)
  {
    short *cbuf = (short *)buf;
    /* we should check for valid parameters, and maybe return 0 */
    r--, r2--, c--, c2--;
    for (; r <= r2; r++)
--- 88,98 ----
    }
    return 1;
  }
  
  int
! _conio_gettext(int c, int r, int c2, int r2, void *buf)
  {
    short *cbuf = (short *)buf;
    /* we should check for valid parameters, and maybe return 0 */
    r--, r2--, c--, c2--;
    for (; r <= r2; r++)
*************** cscanf(const char *fmt, ...)
*** 729,739 ****
  int
  movetext(int left, int top, int right, int bottom, int dleft, int dtop)
  {
    char    *buf = alloca((right - left + 1) * (bottom - top + 1) * 2);
    
!   gettext(left, top, right, bottom, buf);
    puttext(dleft, dtop, dleft + right - left, dtop + bottom - top, buf);
    return 1;
  }
  
  static void
--- 729,739 ----
  int
  movetext(int left, int top, int right, int bottom, int dleft, int dtop)
  {
    char    *buf = alloca((right - left + 1) * (bottom - top + 1) * 2);
    
!   _conio_gettext(left, top, right, bottom, buf);
    puttext(dleft, dtop, dleft + right - left, dtop + bottom - top, buf);
    return 1;
  }
  
  static void
