Skip to content

Commit

Permalink
configure.in: define the {int,uint}*_t types with AC_TYPE_*.
Browse files Browse the repository at this point in the history
* * *
drop d_size
  • Loading branch information
jeremyhenty committed Jan 8, 2011
1 parent 86c91dc commit 25a421b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 39 deletions.
1 change: 0 additions & 1 deletion .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
^missing$
(^|/)tags$
^src/dillo$
^d_size\.h$
^dpi/[^/]*\.dpi$
^dpid/dpid$
^dpid/dpidc$
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SUBDIRS = lout dw dlib dpip src doc dpid dpi test

EXTRA_DIST = Doxyfile dillorc install-dpi-local
EXTRA_DIST = Doxyfile dillorc install-dpi-local d_size.h

sysconf_DATA = dillorc
21 changes: 21 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,29 @@
/* Version number of package */
#undef VERSION

/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT32_T

/* Use char pointers for newer libiconv */
#undef inbuf_t

/* Define to the type of a signed integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#undef int16_t

/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef int32_t

/* Define the real type of socklen_t */
#undef socklen_t

/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#undef uint16_t

/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef uint32_t
41 changes: 4 additions & 37 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,43 +53,10 @@ AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *)

case 2 in
$ac_cv_sizeof_short) gint16=short;;
$ac_cv_sizeof_int) gint16=int;;
esac
case 4 in
$ac_cv_sizeof_short) gint32=short;;
$ac_cv_sizeof_int) gint32=int;;
$ac_cv_sizeof_long) gint32=long;;
esac

cat >d_size.h <<_______EOF
#ifndef __D_SIZE_H__
#define __D_SIZE_H__


#include "config.h"

#if HAVE_STDINT_H == 0
#include <stdint.h>
#elif defined(HAVE_INTTYPES_H)
#include <inttypes.h>
#else
typedef signed $gint16 int16_t;
typedef unsigned $gint16 uint16_t;
typedef signed $gint32 int32_t;
typedef unsigned $gint32 uint32_t;
#endif
typedef unsigned char uchar_t;
typedef unsigned short ushort_t;
typedef unsigned long ulong_t;
typedef unsigned int uint_t;
typedef unsigned char bool_t;


#endif /* __D_SIZE_H__ */
_______EOF

AC_TYPE_INT16_T
AC_TYPE_UINT16_T
AC_TYPE_INT32_T
AC_TYPE_UINT32_T

dnl --------------------------------------
dnl Check whether to add /usr/local or not
Expand Down
24 changes: 24 additions & 0 deletions d_size.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef __D_SIZE_H__
#define __D_SIZE_H__


#include "config.h"

#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#else
/* config.h defines {int,uint}*_t */
#endif /* HAVE_INTTYPES_H */
#endif /*HAVE_STDINT_H */

typedef unsigned char uchar_t;
typedef unsigned short ushort_t;
typedef unsigned long ulong_t;
typedef unsigned int uint_t;
typedef unsigned char bool_t;


#endif /* __D_SIZE_H__ */

0 comments on commit 25a421b

Please sign in to comment.