"Fossies" - the Fresh Open Source Software Archive

Member "zsync-0.6.2/autotools/sockinttypes.m4" (16 Sep 2010, 5724 Bytes) of package /linux/privat/old/zsync-0.6.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 dnl *
    2 dnl * Copyright (c) 2001, 2003  Motoyuki Kasahara
    3 dnl *
    4 dnl * Redistribution and use in source and binary forms, with or without
    5 dnl * modification, are permitted provided that the following conditions
    6 dnl * are met:
    7 dnl * 1. Redistributions of source code must retain the above copyright
    8 dnl *    notice, this list of conditions and the following disclaimer.
    9 dnl * 2. Redistributions in binary form must reproduce the above copyright
   10 dnl *    notice, this list of conditions and the following disclaimer in the
   11 dnl *    documentation and/or other materials provided with the distribution.
   12 dnl * 3. Neither the name of the project nor the names of its contributors
   13 dnl *    may be used to endorse or promote products derived from this software
   14 dnl *    without specific prior written permission.
   15 dnl * 
   16 dnl * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
   17 dnl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   18 dnl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   19 dnl * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORSBE
   20 dnl * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   21 dnl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   22 dnl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   23 dnl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   24 dnl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   25 dnl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
   26 dnl * THE POSSIBILITY OF SUCH DAMAGE.
   27 dnl *
   28 
   29 dnl * 
   30 dnl * Check for socklen_t.
   31 dnl * 
   32 AC_DEFUN([X_TYPE_SOCKLEN_T],
   33 [AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
   34 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
   35 #include <sys/types.h>
   36 #include <sys/socket.h>]], [[
   37 socklen_t socklen;
   38 ]])],[ac_cv_type_socklen_t=yes],[ac_cv_type_socklen_t=no])])
   39 if test "$ac_cv_type_socklen_t" != yes; then
   40     AC_DEFINE(socklen_t, int,
   41 [Define to `int' if <sys/types.h> or <sys/socket.h> does not define.])
   42 fi])
   43 
   44 dnl * 
   45 dnl * Check for in_port_t.
   46 dnl * 
   47 AC_DEFUN([X_TYPE_IN_PORT_T],
   48 [AC_CACHE_CHECK([for in_port_t], ac_cv_type_in_port_t,
   49 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
   50 #include <sys/types.h>
   51 #include <sys/socket.h>
   52 #include <netinet/in.h>]], [[
   53 in_port_t in_port;
   54 ]])],[ac_cv_type_in_port_t=yes],[ac_cv_type_in_port_t=no])])
   55 if test "$ac_cv_type_in_port_t" != yes; then
   56     ac_cv_sin_port_size=unknown
   57     AC_RUN_IFELSE([AC_LANG_SOURCE([[
   58     #include <sys/types.h>
   59     #include <sys/socket.h>
   60     #include <netinet/in.h>
   61     int main() {
   62 	struct sockaddr_in addr;
   63 	return (sizeof(addr.sin_port) == sizeof(long)) ? 0 : 1;
   64     }
   65     ]])],[ac_cv_sin_port_size=long],[],[])
   66     AC_RUN_IFELSE([AC_LANG_SOURCE([[
   67     #include <sys/types.h>
   68     #include <sys/socket.h>
   69     #include <netinet/in.h>
   70     int main() {
   71 	struct sockaddr_in addr;
   72 	return (sizeof(addr.sin_port) == sizeof(int)) ? 0 : 1;
   73     }
   74     ]])],[ac_cv_sin_port_size=int],[],[])
   75     AC_RUN_IFELSE([AC_LANG_SOURCE([[
   76     #include <sys/types.h>
   77     #include <sys/socket.h>
   78     #include <netinet/in.h>
   79     int main() {
   80 	struct sockaddr_in addr;
   81 	return (sizeof(addr.sin_port) == sizeof(short)) ? 0 : 1;
   82     }
   83     ]])],[ac_cv_sin_port_size=short],[],[])
   84     AC_RUN_IFELSE([AC_LANG_SOURCE([[
   85     #include <sys/types.h>
   86     #include <sys/socket.h>
   87     #include <netinet/in.h>
   88     int main() {
   89 	struct sockaddr_in addr;
   90 	return (sizeof(addr.sin_port) == sizeof(char)) ? 0 : 1;
   91     }
   92     ]])],[ac_cv_sin_port_size=char],[],[])
   93     if test "$ac_cv_sin_port_size" = unknown; then
   94 	AC_MSG_ERROR([Failed to get size of sin_port in struct sockaddr_in.])
   95     fi
   96     AC_DEFINE_UNQUOTED(in_port_t, unsigned $ac_cv_sin_port_size,
   97 [Define to `unsigned char', `unsigned short', `unsigned int' or
   98 `unsigned long' according with size of `sin_port' in `struct sockaddr_in',
   99 if <sys/types.h>, <sys/socket.h> or <netinet/in.h> does not define
  100 `in_port_t'.])
  101 fi])
  102 
  103 dnl * 
  104 dnl * Check for sa_family_t.
  105 dnl * 
  106 AC_DEFUN([X_TYPE_SA_FAMILY_T],
  107 [AC_CACHE_CHECK([for sa_family_t], ac_cv_type_sa_family_t,
  108 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  109 #include <sys/types.h>
  110 #include <sys/socket.h>]], [[
  111 sa_family_t sa_family;
  112 ]])],[ac_cv_type_sa_family_t=yes],[ac_cv_type_sa_family_t=no])])
  113 if test "$ac_cv_type_sa_family_t" != yes; then
  114     ac_cv_sa_family_size=unknown
  115     AC_RUN_IFELSE([AC_LANG_SOURCE([[
  116     #include <sys/types.h>
  117     #include <sys/socket.h>
  118     int main() {
  119 	struct sockaddr addr;
  120 	return (sizeof(addr.sa_family) == sizeof(long)) ? 0 : 1;
  121     }
  122     ]])],[ac_cv_sa_family_size=long],[],[])
  123     AC_RUN_IFELSE([AC_LANG_SOURCE([[
  124     #include <sys/types.h>
  125     #include <sys/socket.h>
  126     int main() {
  127 	struct sockaddr addr;
  128 	return (sizeof(addr.sa_family) == sizeof(int)) ? 0 : 1;
  129     }
  130     ]])],[ac_cv_sa_family_size=int],[],[])
  131     AC_RUN_IFELSE([AC_LANG_SOURCE([[
  132     #include <sys/types.h>
  133     #include <sys/socket.h>
  134     int main() {
  135 	struct sockaddr addr;
  136 	return (sizeof(addr.sa_family) == sizeof(short)) ? 0 : 1;
  137     }
  138     ]])],[ac_cv_sa_family_size=short],[],[])
  139     AC_RUN_IFELSE([AC_LANG_SOURCE([[
  140     #include <sys/types.h>
  141     #include <sys/socket.h>
  142     int main() {
  143 	struct sockaddr addr;
  144 	return (sizeof(addr.sa_family) == sizeof(char)) ? 0 : 1;
  145     }
  146     ]])],[ac_cv_sa_family_size=char],[],[])
  147     if test "$ac_cv_sa_family_size" = unknown; then
  148 	AC_MSG_ERROR([Failed to get size of sa_family in struct sockaddr.])
  149     fi
  150     AC_DEFINE_UNQUOTED(sa_family_t, unsigned $ac_cv_sa_family_size,
  151 [Define to `unsigned char', `unsigned short', `unsigned int' or
  152 `unsigned long' according with size of `sa_family' in `struct sockaddr',
  153 if <sys/types.h> or <sys/socket.h> does not define `sa_family_t'.])
  154 fi])