help-libidn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unistd.h include in stringprep.h (was: Re: libidn 1.23)


From: Simon Josefsson
Subject: unistd.h include in stringprep.h (was: Re: libidn 1.23)
Date: Fri, 25 Nov 2011 10:01:20 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux)

Bruno Haible <address@hidden> writes:

> * mingw with MSVC 9 as compiler
>
> Compilation failure:
>
> make[3]: Entering directory 
> `/home/bruno/multibuild-1530/msvc9/libidn-1.23/lib'
>   CC     nfkc.lo
> nfkc.c
> c:\cygwin\home\bruno\multibuild-1530\msvc9\libidn-1.23\lib\stringprep.h(39) : 
> fatal error C1083: include file cannot be opened: "unistd.h": No such file or 
> directory
>
> The following copies of unistd.h exist:
>
>    gl/unistd.h
>    win32/include/unistd.h
>
> You should probably include the 'unistd' module if you want to #include 
> <unistd.h>
> unconditionally. Or add an option -I../gl .

The #include happens in an installed header file, so the gnulib module
wouldn't help here.

However, the only reason we include unistd.h is in order to get ssize_t.
That type is often usually found in sys/types.h as well.  Does MSVC have
sys/types.h?  Regardless, I think using sys/types.h is better than
unistd.h so I'll make this change now and do some testing.

If MSVC doesn't have sys/types.h I don't know what to do.  GnuTLS
generates its header files that contains this:

/* Get ssize_t. */
#ifndef HAVE_SSIZE_T
#define HAVE_SSIZE_T
/* *INDENT-OFF* */
@DEFINE_SSIZE_T@
/* *INDENT-ON* */
#endif

and then have a configure.ac check looking like this:

AC_CHECK_TYPE(ssize_t,
  [
    DEFINE_SSIZE_T="#include <sys/types.h>"
    AC_SUBST(DEFINE_SSIZE_T)
  ], [
    AC_DEFINE([NO_SSIZE_T], 1, [no ssize_t type was found])
    DEFINE_SSIZE_T="typedef int ssize_t;"
    AC_SUBST(DEFINE_SSIZE_T)
  ], [
    #include <sys/types.h>
  ])

However stringprep.h is not a generated file, and making it one has a
bunch of other maintainance issues that I'd like to avoid if possible.

I'm really hoping all useful targets have sys/types.h that provides
ssize_t though.

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]