defining uint64_t, etc., during configure

Igor Sysoev igor at sysoev.ru
Thu Apr 29 17:55:27 MSD 2010


On Thu, Apr 29, 2010 at 09:46:00AM -0400, Brian Lewis wrote:

> On Thursday, 29.04.10 at 10:30, Igor Sysoev wrote:
> > On Wed, Apr 28, 2010 at 04:07:57PM -0400, Brian Lewis wrote:
> > > checking for in_addr_t ... in_addr_t not found uint32_t not found
> > > ./configure: error: can not define in_addr_t
> >
> > What is in objs/autoconf.err after
> > checking for sys/bitypes.h
> > ?
> 
> There are no errors in that section. <sys/bitypes.h> defines u_int32_t,
> though.

Well, here is a new patch.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/os/unix/ngx_posix_config.h
===================================================================
--- src/os/unix/ngx_posix_config.h	(revision 2825)
+++ src/os/unix/ngx_posix_config.h	(working copy)
@@ -33,6 +33,9 @@
 #if (NGX_HAVE_INTTYPES_H)
 #include <inttypes.h>
 #endif
+#if (NGX_HAVE_SYS_BITYPES_H)
+#include <sys/bitypes.h>
+#endif
 #include <stdarg.h>
 #include <stddef.h>             /* offsetof() */
 #include <stdio.h>
Index: auto/unix
===================================================================
--- auto/unix	(revision 2825)
+++ auto/unix	(working copy)
@@ -30,15 +30,22 @@
     ;;
 esac
 
-ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
+ngx_type="int64_t"; ngx_types="long long"; . auto/types/typedef
 
+ngx_type="uint64_t"; ngx_types="u_int64_t:unsigned long long"
+. auto/types/typedef
+
+ngx_type="int32_t"; ngx_types="int"; . auto/types/typedef
+
+ngx_type="uint32_t"; ngx_types="u_int32_t:unsigned int"; . auto/types/typedef
+
 ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
 . auto/types/sizeof
 ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
 
 ngx_type="socklen_t"; ngx_types="int"; . auto/types/typedef
 
-ngx_type="in_addr_t"; ngx_types="uint32_t"; . auto/types/typedef
+ngx_type="in_addr_t"; ngx_types="uint32_t:u_int32_t"; . auto/types/typedef
 
 ngx_type="in_port_t"; ngx_types="u_short"; . auto/types/typedef
 
Index: auto/types/sizeof
===================================================================
--- auto/types/sizeof	(revision 2825)
+++ auto/types/sizeof	(working copy)
@@ -21,6 +21,7 @@
 #include <signal.h>
 #include <sys/resource.h>
 $NGX_INCLUDE_INTTYPES_H
+$NGX_INCLUDE_SYS_BITYPES_H
 $NGX_INCLUDE_AUTO_CONFIG_H
 
 int main() {
Index: auto/types/typedef
===================================================================
--- auto/types/typedef	(revision 2825)
+++ auto/types/typedef	(working copy)
@@ -12,6 +12,8 @@
 END
 
 ngx_found=no
+ngx_ifs=$IFS
+IFS=:
 
 for ngx_try in $ngx_type $ngx_types
 do
@@ -25,6 +27,7 @@
 #include <sys/resource.h>
 #include <netinet/in.h>
 $NGX_INCLUDE_INTTYPES_H
+$NGX_INCLUDE_SYS_BITYPES_H
 
 int main() {
     $ngx_try i = 0;
@@ -74,3 +77,5 @@
 if [ $ngx_found != yes ]; then
     echo "typedef $ngx_found  $ngx_type;"   >> $NGX_AUTO_CONFIG_H
 fi
+
+IFS=$ngx_ifs
Index: auto/headers
===================================================================
--- auto/headers	(revision 2825)
+++ auto/headers	(working copy)
@@ -9,4 +9,5 @@
 ngx_include="sys/param.h";   . auto/include
 ngx_include="sys/mount.h";   . auto/include
 ngx_include="sys/statvfs.h"; . auto/include
+ngx_include="sys/bitypes.h"; . auto/include
 ngx_include="crypt.h";       . auto/include


More information about the nginx mailing list