Add rpmdb/rpmints.h.in.
authorRalf Corsépius <corsepiu@fedoraproject.org>
Wed, 24 Oct 2007 16:38:18 +0000 (18:38 +0200)
committerRalf Corsépius <corsepiu@fedoraproject.org>
Wed, 24 Oct 2007 16:38:18 +0000 (18:38 +0200)
Makefile.am
configure.ac
rpmdb/header.h
rpmdb/rpmints.h.in [new file with mode: 0644]

index 584fa70..de82ee3 100644 (file)
@@ -35,6 +35,7 @@ AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
 
 pkginclude_HEADERS =
+nodist_pkginclude_HEADERS =
 
 pkginclude_HEADERS += rpmio/argv.h
 pkginclude_HEADERS += rpmio/rpmio.h
@@ -47,7 +48,8 @@ pkginclude_HEADERS += rpmio/rpmsq.h
 pkginclude_HEADERS += rpmio/rpmsw.h
 
 pkginclude_HEADERS += rpmdb/header.h
-pkginclude_HEADERS += rpmdb/rpmdb.h 
+pkginclude_HEADERS += rpmdb/rpmdb.h
+nodist_pkginclude_HEADERS += rpmdb/rpmints.h
 
 pkginclude_HEADERS += lib/idtx.h
 pkginclude_HEADERS += lib/rpmcli.h
index dacd8d5..1d403cb 100644 (file)
@@ -1081,6 +1081,12 @@ AM_CONDITIONAL([APIDOCS],[test "$with_apidocs" == yes])
 
 AC_PATH_PROG(AUTOM4TE,autom4te,:)
 
+AS_IF([test "$ac_cv_header_stdint_h" = "yes"],[
+AC_DEFINE([__RPM_USES_STDINT_H__],[1],[if rpm uses stdint.h])
+])
+
+AM_CONFIG_HEADER([rpmdb/rpmints.h])
+
 AC_CONFIG_FILES([Makefile
        rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile
        po/Makefile.in scripts/Makefile 
index ad44494..bf49f1a 100644 (file)
 /* RPM - Copyright (C) 1995-2001 Red Hat Software */
 
 #include "rpmio.h"
+#include "rpmints.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#if 0  /* XXX hpux needs -Ae in CFLAGS to grok this */
-typedef long long int int_64;
-#endif
-typedef int int_32;
-typedef short int int_16;
-typedef char int_8;
-
-#if 0  /* XXX hpux needs -Ae in CFLAGS to grok this */
-typedef unsigned long long int uint_64;
-#endif
-typedef unsigned int uint_32;
-typedef unsigned short uint_16;
-typedef unsigned char uint_8;
-
 /** \ingroup header
  */
 typedef const char *   errmsg_t;
diff --git a/rpmdb/rpmints.h.in b/rpmdb/rpmints.h.in
new file mode 100644 (file)
index 0000000..6a93b99
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef _RPM_RPMINTS_H
+#define _RPM_RPMINTS_H
+
+/* if rpm uses stdint.h */
+#undef __RPM_USES_STDINT_H__
+
+#ifdef __RPM_USES_STDINT_H__
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int32_t        int_32;
+typedef int16_t        int_16;
+typedef int8_t         int_8;
+
+typedef uint32_t       uint_32;
+typedef uint16_t       uint_16;
+typedef uint8_t        uint_8;
+
+#ifdef __cplusplus
+}
+#endif
+
+#else
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int            int_32;
+typedef short int      int_16;
+typedef char           int_8;
+
+typedef unsigned int   uint_32;
+typedef unsigned short uint_16;
+typedef unsigned char  uint_8;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif