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

use of HAVE_STDINT_H in lib/sha2.c in xymon-4.3.0-beta2



Hi,

lib/sha2.c has:

#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
typedef unsigned char uint8_t;
typedef unsigned int  uint32_t;
typedef unsigned long long uint64_t;
#endif

while there is no previous attempt to detect and set HAVE_STDINT_H
anywhere, which means the else part will fire, and cause:

sha2.c:59: error: conflicting types for '__uint64_t'
/usr/include/machine/int_types.h:54: error: previous declaration of '__uint64_t' was here

due to string.h already pulling in a conflicting definition on NetBSD.

The following:

--- build/Makefile.NetBSD.orig  2010-02-08 23:58:57.000000000 +0000
+++ build/Makefile.NetBSD
@@ -10,7 +10,8 @@ NETLIBS =
 CC= gcc
 PKGDIR?=/usr/pkg
 CFLAGS = -g -O2 -Wall -Wno-unused -D_REENTRANT $(LFSDEF) $(OSDEF) \
-       -I${PKGDIR}/include -L${PKGDIR}/lib, -Wl,--rpath=${PKGDIR}/lib
+       -I${PKGDIR}/include -L${PKGDIR}/lib, -Wl,--rpath=${PKGDIR}/lib \
+       -DHAVE_STDINT_H
 RPATH = "-Wl,--rpath,"
 
 # Compile flags for debugging

takes care of that. (Not elegantly, but duh :)
Other OSes might need similar measures too.

regards,
	spz
-- 
spz (at) serpens.de (S.P.Zeidler)