diff -c termcap/termcap.c c:termcap/termcap.c
*** termcap/termcap.c	Thu Aug 17 01:50:06 1995
--- c:termcap/termcap.c	Mon Nov 06 03:13:36 1995
***************
*** 15,20 ****
--- 15,22 ----
  along with this program; see the file COPYING.  If not, write to
  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  
+ /* Modified for emx by Eberhard Mattes, Nov 1995 */
+ 
  /* Emacs config.h may rename various library functions such as malloc.  */
  #ifdef HAVE_CONFIG_H
  
***************
*** 360,365 ****
--- 362,373 ----
  static int compare_contin ();
  static int name_match ();
  
+ #ifdef EMX
+ 
+ #define valid_filename_p(fn) \
+ 	(*(fn) == '/' || *(fn) == '\\' || _fngetdrive (fn))
+ 
+ #else /* not EMX */
  #ifdef VMS
  
  #include <rmsdef.h>
***************
*** 399,404 ****
--- 407,413 ----
  #endif
  
  #endif /* !VMS */
+ #endif /* not EMX */
  
  /* Find the termcap entry data for terminal type NAME
     and store it in the block that BP points to.
***************
*** 489,495 ****
  
    /* Here we know we must search a file and termcap_name has its name.  */
  
! #ifdef MSDOS
    fd = open (termcap_name, O_RDONLY|O_TEXT, 0);
  #else
    fd = open (termcap_name, O_RDONLY, 0);
--- 498,504 ----
  
    /* Here we know we must search a file and termcap_name has its name.  */
  
! #if defined (MSDOS) || defined (EMX)
    fd = open (termcap_name, O_RDONLY|O_TEXT, 0);
  #else
    fd = open (termcap_name, O_RDONLY, 0);
diff -c termcap/termcap.h c:termcap/termcap.h
*** termcap/termcap.h	Wed Jul 26 19:09:50 1995
--- c:termcap/termcap.h	Mon Nov 06 03:03:02 1995
***************
*** 15,23 ****
--- 15,29 ----
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  
+ /* Modified for emx by Eberhard Mattes, Nov 1995 */
+ 
  #ifndef _TERMCAP_H
  #define _TERMCAP_H 1
  
+ #if defined (__cplusplus)
+ extern "C" {
+ #endif
+ 
  #if __STDC__
  
  extern int tgetent (char *buffer, const char *termtype);
***************
*** 58,62 ****
--- 64,72 ----
  extern char *tgoto ();
  
  #endif /* not __STDC__ */
+ 
+ #if defined (__cplusplus)
+ }
+ #endif
  
  #endif /* not _TERMCAP_H */
