2014-01-29  Juan Manuel Guerrero <juan.guerrero@gmx.de>

	* lib/stdint.in.h [__DJGPP__, MAKE_DXE3]:  For DJGPP 2.04, the typedef
	of gl_[u]int32_t must be signed long as in stdint.h but if compiled
	with libc.a from CVS repository then gl_[u]int32_t must be signed
	long.  If compiled with libc from CVS  repository the macro
	MAKE_DXE3 must be defined.

	* lib/stdint.mini.h [__DJGPP__, MAKE_DXE3]:  For DJGPP 2.04, the
	typedef of gl_[u]int32_t must be signed long as in stdint.h but if
	compiled with libc.a from CVS repository then gl_[u]int32_t must be
	signed long.  If compiled with libc from CVS  repository the macro
	MAKE_DXE3 must be defined.


2013-12-30  Juan Manuel Guerrero <juan.guerrero@gmx.de>

	* libunistring-0.9.3/tests/test-errno.c [__DJGPP__]:  Exclude from test
	all errnos not supported by DJGPP.

	* libunistring-0.9.3/tests/test-strerror.c (main) [__DJGPP__]:  Exclude
	ETIMEDOUT check.

	* libunistring-0.9.3/tests/zerosize-ptr.h [MAP_PRIVATE]:  If not defined
	define MAP_PRIVATE.
	(zerosize_ptr) [__DJGPP__]:  Return always NULL pointer because DJGPP
	provides no mmap.


2013-12-29  Juan Manuel Guerrero <juan.guerrero@gmx.de>

	* lib/stdio-impl.h [__DJGPP__]:  Include sys/file.h to provide _IOERR
	definition to be used in fseterr function.







diff -aprNU5 libunistring-0.9.3.orig/lib/stdint.in.h libunistring-0.9.3/lib/stdint.in.h
--- libunistring-0.9.3.orig/lib/stdint.in.h	2010-04-03 09:43:56 +0100
+++ libunistring-0.9.3/lib/stdint.in.h	2014-01-31 13:26:08 +0100
@@ -126,12 +126,17 @@ typedef unsigned short int gl_uint16_t;
 #define int16_t gl_int16_t
 #define uint16_t gl_uint16_t
 
 #undef int32_t
 #undef uint32_t
+#if __DJGPP__ == 2 && __DJGPP_MINOR__ == 4 && !defined(MAKE_DXE3)
+typedef signed long gl_int32_t;
+typedef unsigned long gl_uint32_t;
+#else
 typedef int gl_int32_t;
 typedef unsigned int gl_uint32_t;
+#endif
 #define int32_t gl_int32_t
 #define uint32_t gl_uint32_t
 
 /* Do not undefine int64_t if gnulib is not being used with 64-bit
    types, since otherwise it breaks platforms like Tandem/NSK.  */
diff -aprNU5 libunistring-0.9.3.orig/lib/stdint.mini.h libunistring-0.9.3/lib/stdint.mini.h
--- libunistring-0.9.3.orig/lib/stdint.mini.h	2009-04-10 20:28:44 +0100
+++ libunistring-0.9.3/lib/stdint.mini.h	2014-01-31 13:26:08 +0100
@@ -111,12 +111,17 @@ typedef unsigned short int unistring_uin
 #define int16_t unistring_int16_t
 #define uint16_t unistring_uint16_t
 
 #undef int32_t
 #undef uint32_t
+#if __DJGPP__ == 2 && __DJGPP_MINOR__ == 4 && !defined(MAKE_DXE3)
+typedef signed long unistring_int32_t;
+typedef unsigned long unistring_uint32_t;
+#else
 typedef int unistring_int32_t;
 typedef unsigned int unistring_uint32_t;
+#endif
 #define int32_t unistring_int32_t
 #define uint32_t unistring_uint32_t
 
 /* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */
 #define _UINT8_T
diff -aprNU5 libunistring-0.9.3.orig/lib/stdio-impl.h libunistring-0.9.3/lib/stdio-impl.h
--- libunistring-0.9.3.orig/lib/stdio-impl.h	2010-05-02 11:22:14 +0100
+++ libunistring-0.9.3/lib/stdio-impl.h	2013-12-30 18:59:48 +0100
@@ -22,10 +22,12 @@
 /* BSD stdio derived implementations.  */
 
 #if defined __NetBSD__                         /* NetBSD */
 /* Get __NetBSD_Version__.  */
 # include <sys/param.h>
+#elif defined __DJGPP__
+# include <libc/file.h>
 #endif
 
 #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
 
 # if defined __DragonFly__          /* DragonFly */
diff -aprNU5 libunistring-0.9.3.orig/tests/test-errno.c libunistring-0.9.3/tests/test-errno.c
--- libunistring-0.9.3.orig/tests/test-errno.c	2010-01-01 10:02:12 +0100
+++ libunistring-0.9.3/tests/test-errno.c	2013-12-30 18:59:48 +0100
@@ -32,11 +32,13 @@ int e6 = ENXIO;
 int e7 = E2BIG;
 int e8 = ENOEXEC;
 int e9 = EBADF;
 int e10 = ECHILD;
 int e11 = EAGAIN;
+#ifndef DJGPP
 int e11a = EWOULDBLOCK;
+#endif
 int e12 = ENOMEM;
 int e13 = EACCES;
 int e14 = EFAULT;
 int e16 = EBUSY;
 int e17 = EEXIST;
@@ -46,11 +48,13 @@ int e20 = ENOTDIR;
 int e21 = EISDIR;
 int e22 = EINVAL;
 int e23 = ENFILE;
 int e24 = EMFILE;
 int e25 = ENOTTY;
+#ifndef DJGPP
 int e26 = ETXTBSY;
+#endif
 int e27 = EFBIG;
 int e28 = ENOSPC;
 int e29 = ESPIPE;
 int e30 = EROFS;
 int e31 = EMLINK;
@@ -69,10 +73,11 @@ int e67 = ENOLINK;
 int e71 = EPROTO;
 int e72 = EMULTIHOP;
 int e74 = EBADMSG;
 int e75 = EOVERFLOW;
 int e84 = EILSEQ;
+#ifndef DJGPP
 int e88 = ENOTSOCK;
 int e89 = EDESTADDRREQ;
 int e90 = EMSGSIZE;
 int e91 = EPROTOTYPE;
 int e92 = ENOPROTOOPT;
@@ -93,12 +98,15 @@ int e107 = ENOTCONN;
 int e110 = ETIMEDOUT;
 int e111 = ECONNREFUSED;
 int e113 = EHOSTUNREACH;
 int e114 = EALREADY;
 int e115 = EINPROGRESS;
+#endif
 int e116 = ESTALE;
+#ifndef DJGPP
 int e122 = EDQUOT;
+#endif
 int e125 = ECANCELED;
 
 /* Don't verify that these errno values are all different, except for possibly
    EWOULDBLOCK == EAGAIN.  Even Linux/x86 does not pass this check: it has
    ENOTSUP == EOPNOTSUPP.  */
diff -aprNU5 libunistring-0.9.3.orig/tests/test-strerror.c libunistring-0.9.3/tests/test-strerror.c
--- libunistring-0.9.3.orig/tests/test-strerror.c	2010-01-01 10:02:12 +0100
+++ libunistring-0.9.3/tests/test-strerror.c	2013-12-30 18:59:48 +0100
@@ -35,13 +35,15 @@ main (void)
 
   str = strerror (EACCES);
   ASSERT (str);
   ASSERT (*str);
 
+#ifndef DJGPP
   str = strerror (ETIMEDOUT);
   ASSERT (str);
   ASSERT (*str);
+#endif
 
   str = strerror (EOVERFLOW);
   ASSERT (str);
   ASSERT (*str);
 
diff -aprNU5 libunistring-0.9.3.orig/tests/zerosize-ptr.h libunistring-0.9.3/tests/zerosize-ptr.h
--- libunistring-0.9.3.orig/tests/zerosize-ptr.h	2010-01-01 10:02:16 +0100
+++ libunistring-0.9.3/tests/zerosize-ptr.h	2013-12-30 18:59:48 +0100
@@ -43,15 +43,18 @@
 static void *
 zerosize_ptr (void)
 {
 /* Use mmap and mprotect when they exist.  Don't test HAVE_MMAP, because it is
    not defined on HP-UX 11 (since it does not support MAP_FIXED).  */
-#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT && !defined(__DJGPP__)
 # if HAVE_MAP_ANONYMOUS
   const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
   const int fd = -1;
 # else /* !HAVE_MAP_ANONYMOUS */
+#  ifndef MAP_PRIVATE
+#   define MAP_PRIVATE  0
+#  endif
   const int flags = MAP_FILE | MAP_PRIVATE;
   int fd = open ("/dev/zero", O_RDONLY, 0666);
   if (fd >= 0)
 # endif
     {
