Groups | Search | Server Info | Login | Register


Groups > comp.databases.berkeley-db > #4

Re: error: conflicting declaration 'typedef int32_t ssize_t' (mingw versus berkeley db)

From "Skybuck Flying" <Windows7IsOK@DreamPC2006.com>
Newsgroups comp.databases.berkeley-db, comp.lang.c
References <3e9fb$4ed19745$5419acc3$27249@cache1.tilbu1.nb.home.nl>
Subject Re: error: conflicting declaration 'typedef int32_t ssize_t' (mingw versus berkeley db)
Date 2011-11-27 03:04 +0100
Message-ID <4e191$4ed19a95$5419acc3$29649@cache1.tilbu1.nb.home.nl> (permalink)
Organization @home

Cross-posted to 2 groups.

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Also to help make sense of it here are the code sections which are apparently conflicting:

// *** Begin of Berkeley DB Snippet ***:

// db.h:

/*
* Berkeley DB version information.
*/
#define DB_VERSION_MAJOR 4
#define DB_VERSION_MINOR 8
#define DB_VERSION_PATCH 30
#define DB_VERSION_STRING "Berkeley DB 4.8.30: (April 12, 2010)"

/*
* !!!
* Berkeley DB uses specifically sized types.  If they're not provided by
* the system, typedef them here.
*
* We protect them against multiple inclusion using __BIT_TYPES_DEFINED__,
* as does BIND and Kerberos, since we don't know for sure what #include
* files the user is using.
*
* !!!
* We also provide the standard u_int, u_long etc., if they're not provided
* by the system.
*/
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
typedef unsigned char u_int8_t;
typedef short int16_t;
typedef unsigned short u_int16_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
typedef __int64 int64_t;
typedef unsigned __int64 u_int64_t;
#endif

#ifndef _WINSOCKAPI_
typedef unsigned char u_char;
typedef unsigned int u_int;
typedef unsigned long u_long;
#endif
typedef unsigned short u_short;

/*
* Missing ANSI types.
*
* uintmax_t --
* Largest unsigned type, used to align structures in memory.  We don't store
* floating point types in structures, so integral types should be sufficient
* (and we don't have to worry about systems that store floats in other than
* power-of-2 numbers of bytes).  Additionally this fixes compilers that rewrite
* structure assignments and ANSI C memcpy calls to be in-line instructions
* that happen to require alignment.
*
* uintptr_t --
* Unsigned type that's the same size as a pointer.  There are places where
* DB modifies pointers by discarding the bottom bits to guarantee alignment.
* We can't use uintmax_t, it may be larger than the pointer, and compilers
* get upset about that.  So far we haven't run on any machine where there's
* no unsigned type the same size as a pointer -- here's hoping.
*/
#if defined(_MSC_VER) && _MSC_VER < 1300
typedef u_int32_t uintmax_t;
#else
typedef u_int64_t uintmax_t;
#endif
#ifdef _WIN64
typedef u_int64_t uintptr_t;
#else
typedef u_int32_t uintptr_t;
#endif

/*
* Windows defines off_t to long (i.e., 32 bits).  We need to pass 64-bit
* file offsets, so we declare our own.
*/
#define off_t __db_off_t
typedef int64_t off_t;
typedef int pid_t;
#ifdef _WIN64
typedef int64_t ssize_t;
#else
typedef int32_t ssize_t;
#endif

// *** End of Berkeley DB Snippet ***

// *** Begin of MingW Snippet ***:

// types.h:

#ifndef _SSIZE_T_
#define _SSIZE_T_
typedef long _ssize_t;

#ifndef _NO_OLDNAMES
typedef _ssize_t ssize_t;
#endif
#endif /* Not _SSIZE_T_ */ 

// *** End of MingW Snippet ***

Please advise,

Bye, 
  Skybuck.

Back to comp.databases.berkeley-db | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

error: conflicting declaration 'typedef int32_t ssize_t' (mingw versus berkeley db) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2011-11-27 02:50 +0100
  Re: error: conflicting declaration 'typedef int32_t ssize_t' (mingw versus berkeley db) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2011-11-27 03:04 +0100
    Re: error: conflicting declaration 'typedef int32_t ssize_t' (mingw versus berkeley db) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2011-11-27 03:27 +0100
    Re: error: conflicting declaration 'typedef int32_t ssize_t' (mingw versus berkeley db) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2011-11-27 04:01 +0100
      Re: error: conflicting declaration 'typedef int32_t ssize_t' (mingw versus berkeley db) "Skybuck Flying" <Windows7IsOK@DreamPC2006.com> - 2011-11-27 19:42 +0100
  Re: error: conflicting declaration 'typedef int32_t ssize_t' (mingw versus berkeley db) ImpalerCore <jadill33@gmail.com> - 2011-11-29 13:07 -0800

csiph-web