bug-commoncpp
[Top][All Lists]
Advanced

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

Re: a small bug?


From: David Sugar
Subject: Re: a small bug?
Date: Mon, 30 Jul 2001 09:56:03 -0400
User-agent: Mozilla/5.0 (X11; U; Linux 2.2.16-9mdk i686; en-US; m18) Gecko/20001013

You must compile using the compile time flags and options returned by "ccgnu-config --flags"

Draky J. Void wrote:

   Hello!

When trying to compile something that inlcludes <cc++/thread.h>, I get
the following error:

/usr/local/include/cc++/thread.h:189:  syntax error before ';"

from file cc++/thread.h:

...

class ThreadLock
{
private:
#ifdef HAVE_PTHREAD_RWLOCK
            pthread_rwlock_t _lock;                 <<--this is the line
189 where the error happens.
#else
            pthread_mutex_t _lock;
#endif

....

Changing #define HAVE_PTHREAD_RWLOCK to #undef HAVE_PTHREAD_RWLOCK in
config.h solves the problem. But
my system has rwlock, and I cannot realise why the error happens. Maybe
I'm doing something wrong?

OS: Linux-Mandrake 8.0, kernel 2.4.7, glibc2.2.
config.h generated by ./configure script on my machine is attached to
the letter. config.def too.


---
Regards, Draky J. Void.



------------------------------------------------------------------------

/* posix/config.h.  Generated automatically by configure.  */
/* posix/config.h.in.  Generated automatically from configure.in by autoheader. 
 */
/*
** This file has been automatically generated by 'acconfig' from aclocal.m4
** Copyright (C) 1988 Eleftherios Gkioulekas <address@hidden>
** ** This file is free software; as a special exception the author gives ** unlimited permission to copy and/or distribute it, with or without ** modifications, as long as this notice is preserved. ** ** This program is distributed in the hope that it will be useful, but
** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

#ifndef __CCXX_CONFIG_H__
#define __CCXX_CONFIG_H__
/* This is the top section */


/* Define if you have <unistd.h>.  */
#define HAVE_UNISTD_H 1

/* Define if on MINIX.  */
/* #undef _MINIX */

/* Define if the system does not provide POSIX.1 features except
   with this defined.  */
/* #undef _POSIX_1_SOURCE */

/* Define if you need to in order for stat and other things to work.  */
/* #undef _POSIX_SOURCE */

/* Define as the return type of signal handlers (int or void).  */
#define RETSIGTYPE void

/* Define if you can safely include both <sys/time.h> and <time.h>.  */
#define TIME_WITH_SYS_TIME 1

/* And now the rest of the boys */
#define __DLL
#define __EXPORT
#define __MEMBER_EXPORT
/* #undef __DLLRTL */
#define __NAMESPACES__ 1
#define HAVE_BOOL_TYPE 1
#define HAVE_EXCEPTION_HANDLING 1
#define HAVE_ENDIAN_H 1
/* #undef __BYTE_ORDER */
#define HAVE_SYS_FCNTL_H 1
#define HAVE_FCNTL_H 1
#define HAVE_SYS_TYPES_STD 1
#define HAVE_SYS_TYPES_64 1
#define HAVE_LONG_LONG 1
/* #undef HAVE_64_BITS */
#define HAVE_SYS_TYPES_H 1
#define HAVE_SIGACTION 1
/* #undef HAVE_BSD_SIGNAL_H */
#define HAVE_STRCASECMP 1
#define HAVE_STRDUP 1
#define HAVE_SETITIMER 1
#define HAVE_STRINGS_H 1
/* #undef HAVE_DLOPEN */
#define HAVE_SIGWAIT2 1
#define HAVE_MODULES 1
#define HAVE_DLFCN_H 1
#define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
#define HAVE_PTHREAD_MUTEXATTR_SETTYPE 1
/* #undef HAVE_PTHREAD_MUTEXATTR_SETTYPE_NP */
/* #undef HAVE_PTHREAD_MUTEXATTR_SETKIND_NP */
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
/* #undef HAVE_PTHREAD_DELAY_NP */
/* #undef HAVE_PTHREAD_SCHED_YIELD */
#define HAVE_PTHREAD_YIELD 1
#define HAVE_PTHREAD_NANOSLEEP 1
#define HAVE_PTHREAD_CANCEL 1
#define HAVE_PTHREAD_SETCANCELTYPE 1
/* #undef HAVE_PTHREAD_SETCANCEL */
#define HAVE_PTHREAD_RWLOCK 1
#define HAVE_PREAD_PWRITE 1
#define HAVE_ASM_ATOMIC_H 1
/* #undef HAVE_SYS_ATOMIC_H */
#define HAVE_SYS_TIME_H 1
#define HAVE_GETOPT_H 1
#define HAVE_GETOPT_LONG 1
/* #undef HAVE_LIBXML */
#define TIME_WITH_SYS_TIME 1
#define _POSIX_PII_SOCKET
#define HAVE_SYS_SOCKET_H 1
#define HAVE_ARPA_INET_H 1
#define HAVE_NETINET_IN_SYSTM_H 1
#define HAVE_NETINET_IP_H 1
#define HAVE_SYS_UN_H 1
/* #undef HAVE_SELECT_H */
#define HAVE_SYS_SELECT_H 1
#define HAVE_INET_ATON 1
#define HAVE_INET_SOCKETS 1
#define HAVE_UNIX_SOCKETS 1
#define HAVE_SOCKLEN_T 1
/* #undef HAVE_SYS_LIBCSYS_H */
/* #undef HAVE_SYS_STREAM_H */
#define HAVE_SYS_POLL_H 1
#define HAVE_POLL_H 1
/* #undef HAVE_ZLIB_H */
/* #undef COMMON_AIX_FIXES */
#define HAVE_FEATURES_H 1
#define HAVE_LOCALTIME_R 1
#define HAVE_STRTOK_R 1
#define HAVE_SETENV 1

/* Define if you have the getopt_long function.  */
#define HAVE_GETOPT_LONG 1

/* Define if you have the poll function.  */
#define HAVE_POLL 1

/* Define if you have the setenv function.  */
#define HAVE_SETENV 1

/* Define if you have the setitimer function.  */
#define HAVE_SETITIMER 1

/* Define if you have the sigaction function.  */
#define HAVE_SIGACTION 1

/* Define if you have the strcasecmp function.  */
#define HAVE_STRCASECMP 1

/* Define if you have the strdup function.  */
#define HAVE_STRDUP 1

/* Define if you have the <arpa/inet.h> header file.  */
#define HAVE_ARPA_INET_H 1

/* Define if you have the <bsd/signal.h> header file.  */
/* #undef HAVE_BSD_SIGNAL_H */

/* Define if you have the <dlfcn.h> header file.  */
#define HAVE_DLFCN_H 1

/* Define if you have the <fcntl.h> header file.  */
#define HAVE_FCNTL_H 1

/* Define if you have the <features.h> header file.  */
#define HAVE_FEATURES_H 1

/* Define if you have the <getopt.h> header file.  */
#define HAVE_GETOPT_H 1

/* Define if you have the <netinet/in_systm.h> header file.  */
#define HAVE_NETINET_IN_SYSTM_H 1

/* Define if you have the <netinet/ip.h> header file.  */
#define HAVE_NETINET_IP_H 1

/* Define if you have the <poll.h> header file.  */
#define HAVE_POLL_H 1

/* Define if you have the <pthread.h> header file.  */
#define HAVE_PTHREAD_H 1

/* Define if you have the <pthread_np.h> header file.  */
/* #undef HAVE_PTHREAD_NP_H */

/* Define if you have the <sched.h> header file.  */
#define HAVE_SCHED_H 1

/* Define if you have the <select.h> header file.  */
/* #undef HAVE_SELECT_H */

/* Define if you have the <semaphore.h> header file.  */
#define HAVE_SEMAPHORE_H 1

/* Define if you have the <strings.h> header file.  */
#define HAVE_STRINGS_H 1

/* Define if you have the <sys/fcntl.h> header file.  */
#define HAVE_SYS_FCNTL_H 1

/* Define if you have the <sys/file.h> header file.  */
#define HAVE_SYS_FILE_H 1

/* Define if you have the <sys/libcsys.h> header file.  */
/* #undef HAVE_SYS_LIBCSYS_H */

/* Define if you have the <sys/poll.h> header file.  */
#define HAVE_SYS_POLL_H 1

/* Define if you have the <sys/sched.h> header file.  */
/* #undef HAVE_SYS_SCHED_H */

/* Define if you have the <sys/select.h> header file.  */
#define HAVE_SYS_SELECT_H 1

/* Define if you have the <sys/socket.h> header file.  */
#define HAVE_SYS_SOCKET_H 1

/* Define if you have the <sys/stream.h> header file.  */
/* #undef HAVE_SYS_STREAM_H */

/* Define if you have the <sys/time.h> header file.  */
#define HAVE_SYS_TIME_H 1

/* Define if you have the <sys/types.h> header file.  */
#define HAVE_SYS_TYPES_H 1

/* Define if you have the <sys/un.h> header file.  */
#define HAVE_SYS_UN_H 1

/* Define if you have the <thread.h> header file.  */
/* #undef HAVE_THREAD_H */

/* Define if you have the <unistd.h> header file.  */
#define HAVE_UNISTD_H 1

/* Define if you have the <winsock.h> header file.  */
/* #undef HAVE_WINSOCK_H */

/* Define if you have the <zlib.h> header file.  */
/* #undef HAVE_ZLIB_H */

/* Define if you have the malloc library (-lmalloc).  */
/* #undef HAVE_LIBMALLOC */

/* Name of package */
#define PACKAGE "CommonC++"

/* Version number of package */
#define VERSION "1.5.0"


#ifdef _AIX
#ifndef _ALL_SOURCE
#define _ALL_SOURCE
#endif
#endif

#ifndef _REENTRANT
#define _REENTRANT 1
#endif
#ifndef _THREAD_SAFE
#define _THREAD_SAFE 1
#endif
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS
#endif

#ifdef  __hpux
#ifndef _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE_EXTENDED
#endif
#ifdef  mutable
/* #undef       mutable */
#endif
#endif

#ifdef  HAVE_FEATURES_H
#include <features.h>
#endif

/* This is the bottom section */
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#else
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
#endif

#if defined(__sun) || defined(__SUN__)
#define __EXTENSIONS__
#endif

#ifndef HAVE_FCNTL_H
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
#else
#include <fcntl.h>
#ifndef O_NDELAY
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
#endif
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_TYPES_STD
typedef int8_t int8;
typedef u_int8_t uint8;
typedef int16_t int16;
typedef u_int16_t uint16;
typedef int32_t int32;
typedef u_int32_t uint32;
#ifdef HAVE_SYS_TYPES_64
#define HAVE_64_BITS
typedef int64_t int64;
typedef u_int64_t uint64;
#endif
#else
typedef char int8;
typedef unsigned char uint8;
typedef short int16;
typedef unsigned short uint16;
typedef int int32;
typedef unsigned int uint32;
#endif
#ifndef HAVE_SYS_TYPES_64
#if defined(HAVE_LONG_LONG) || defined(_LONGLONG)
#define HAVE_64_BITS
typedef long long int64;
typedef unsigned long long uint64;
#else
#ifdef __arch64__
#define HAVE_64_BITS
typedef long int int64;
typedef unsigned long int uint64;
#endif
#endif
#endif

#ifdef HAVE_SIGACTION
#ifdef HAVE_BSD_SIGNAL_H
/* #undef HAVE_BSD_SIGNAL_H */
#endif
#endif

#ifdef HAVE_BSD_SIGNAL_H
#include <bsd/signal.h>
#else
#include <signal.h>
#endif

#ifndef SA_ONESHOT
#define SA_ONESHOT SA_RESETHAND
#endif

#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif

#ifdef HAVE_STRCASECMP
#ifndef stricmp
#define stricmp(x,y) strcasecmp(x,y)
#endif
#ifndef strnicmp
#define strnicmp(x,y,n) strncasecmp(x,y,n)
#endif
#endif

#ifndef HAVE_STRDUP
#define strdup(s) (char *)malloc(strlen(s))
#endif


#ifdef HAVE_THREAD_H
#include "/usr/include/thread.h"
#if defined(i386) && defined(__svr4__)
#define _THR_UNIXWARE
#endif
#if defined(__SVR4) && defined(__sun)
#define _THR_SUNOS5
#else
#if defined(__SVR4__) && defined(__SUN__)
#define _THR_SUNOS5
#endif
#endif
#endif

#ifdef HAVE_SYS_ATOMIC_H
#include <sys/atomic.h>
#define HAVE_ATOMIC
#else
#ifdef HAVE_ASM_ATOMIC_H
#include <asm/atomic.h>
#define HAVE_ATOMIC
#endif
#endif

#if defined(HAVE_PTHREAD_H) && ( defined(_THREAD_SAFE) || defined(_REENTRANT) )

#include <pthread.h>

#ifdef HAVE_PTHREAD_NP_H
#include <pthread_np.h>
#endif
#ifdef HAVE_SEMAPHORE_H
#include <semaphore.h>
#endif
#ifdef _POSIX_PRIORITY_SCHEDULING
#ifdef HAVE_SCHED_H
#include <sched.h>
#else
#ifdef HAVE_SYS_SCHED_H
#include <sys/sched.h>
#endif
#endif
#endif

#define __PTHREAD_H__
#ifndef PTHREAD_MUTEXTYPE_RECURSIVE
#ifdef  MUTEX_TYPE_COUNTING_FAST
#define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
#endif
#endif
#ifndef PTHREAD_MUTEXTYPE_RECURSIVE
#ifdef  PTHREAD_MUTEX_RECURSIVE
#define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
#endif
#endif
#ifndef HAVE_PTHREAD_MUTEXATTR_SETTYPE
#if     HAVE_PTHREAD_MUTEXATTR_SETKIND_NP
#ifndef PTHREAD_MUTEXTYPE_RECURSIVE
#define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
#endif
#define pthread_mutexattr_gettype(x, y) pthread_mutexattr_getkind_np(x, y)
#define pthread_mutexattr_settype(x, y) pthread_mutexattr_setkind_np(x, y)
#endif #if HAVE_PTHREAD_MUTEXATTR_SETTYPE_NP
#ifndef PTHREAD_MUTEXTYPE_RECURSIVE
#define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
#endif
#define pthread_mutexattr_settype(x, y) pthread_mutexattr_settype_np(x, y)
#define pthread_mutexattr_gettype(x, y) pthread_mutexattr_gettype_np(x, y)
#endif
#endif

#ifndef HAVE_PTHREAD_YIELD
#ifdef HAVE_PTHREAD_SCHED_YIELD
#define pthread_yield() sched_yield()
#define HAVE_PTHREAD_YIELD
#endif
#endif

#ifndef HAVE_PTHREAD_DELAY
#ifdef HAVE_PTHREAD_DELAY_NP
#define HAVE_PTHREAD_DELAY
#define pthread_delay(x) pthread_delay_np(x)
#endif
#ifdef HAVE_PTHREAD_NANOSLEEP
#ifndef HAVE_PTHREAD_DELAY
#define HAVE_PTHREAD_DELAY
#define pthread_delay(x) nanosleep(x, NULL)
#endif
#endif
#endif

#ifdef HAVE_PTHREAD_ATTR_SETSTACK
#ifndef PTHREAD_STACK_MIN
#define PTHREAD_STACK_MIN 32768
#endif
#endif

#ifndef HAVE_PTHREAD_CANCEL
#ifdef SIGCANCEL
#define _SIG_THREAD_CANCEL SIGCANCEL
#else
#define _SIG_THREAD_CANCEL SIGQUIT
#endif
#define pthread_cancel(x) pthread_kill(x, _SIG_THREAD_CANCEL)
#endif

#ifndef HAVE_PTHREAD_SETCANCELTYPE
#ifdef HAVE_PTHREAD_SETCANCEL
enum
{ PTHREAD_CANCEL_ASYNCHRONOUS = CANCEL_ON,
  PTHREAD_CANCEL_DEFERRED = CANCEL_OFF};
enum
{ PTHREAD_CANCEL_ENABLE = CANCEL_ON,
  PTHREAD_CANCEL_DISABLE = CANCEL_OFF};
#define pthread_setcancelstate(x, y) \
        (y == NULL) ? pthread_setcancel(x) : *y = pthread_setcancel
#define pthread_setcanceltype(x, y) \
        (y == NULL) ? pthread_setasynccancel(x) | *y = pthread_setasynccancel(x)
#else
#define pthread_setcanceltype(x, y)
#define pthread_setcancelstate(x, y)
#endif
#endif

#endif

#if TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <time.h>
#endif
#endif

#ifndef HAVE_STRTOK_R
#define strtok_r(s, d, r) strtok(s, d)
#endif
#ifndef HAVE_LOCALTIME_R
#define localtime_r(t, b) localtime(t)
#define ctime_r(t, b) ctime(t)
#define gmtime_r(t, b) gmtime(t)
#define asctime_r(t, b) asctime(t)
#endif

#ifdef HAVE_SYS_LIBCSYS_H
#include <sys/libcsys.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#else
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#ifdef HAVE_SELECT_H
#include <select.h>
#else
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#endif
#ifdef HAVE_ARPA_INET_H
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#endif
#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
#endif
#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#endif
#endif

#ifndef HAVE_INET_ATON
#define inet_aton(cp, addr) \
        (((*(unsigned long int *)(addr)) = inet_addr(cp)) != -1)
#endif

#ifndef SUN_LEN
#ifdef SCM_RIGHTS
#define HAVE_UN_LEN
#endif
#ifdef __linux
#define HAVE_UN_LEN
#endif
#ifdef HAVE_UN_LEN
#define SUN_LEN(ptr) sizeof(sockaddr_un.sun_len) + \
        sizeof(sockaddr_un.sun_family) + sizeof(sockaddr_un.sun_path) + 1
#else
#define SUN_LEN(ptr) ((size_t)((struct sockaddr_un *)0)->sun_path) \
        + strlen((ptr)->sun_path))
#endif
#endif

#ifndef HAVE_SOCKLEN_T
#if defined(i386) && defined(__svr4__)
#define HAVE_SOCKLEN_U
#endif
#ifdef HAVE_SOCKLEN_U
typedef unsigned socklen_t;
#else
typedef int socklen_t;
#endif
#endif

#ifdef HAVE_POLL_H
#include <poll.h>
#else
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif
#endif

/**
 ** define these after the last system header has been included
 ** so that these do not interfere with them.
 **/

// Add bool support if missing
#ifndef HAVE_BOOL_TYPE
typedef enum { true=1, false=0 } bool;
#endif

// replace 'throw' with abort for libs on broken C++
#ifndef HAVE_EXCEPTION_HANDLING
/* throw - replacement to throw an exception */
#define THROW(x) abort()
/* throw - replacement to declare an exception */
#define THROWS(x)
/*
 * work around dangeling if/else combinations:
 */
#define try if(0) ; else
#define catch(x) if(1) ; else
#else
#define THROW(x) throw x
#define THROWS(x) throw(x)
#endif

#ifdef  __NAMESPACES__
#define USING(x)        using namespace x;
#else
#define USING(x)
#endif

#ifdef  __KCC
#define KAI_NONSTD_IOSTREAM 1
#endif

#ifdef __FreeBSD__
#define ETC_PREFIX "/usr/local/etc/"
#endif

#ifndef ETC_PREFIX
#define ETC_PREFIX "/etc/"
#endif

#endif


------------------------------------------------------------------------

# Used to hold linker flags for "autoconfig" of applications
# Commonly accessed through grep and sed.

flags:-D_REENTRANT -D_THREAD_SAFE  -g -O2 -D_GNU_SOURCE
link: -pthread load:-ldl
extra:
config.h

Content-Type:

text/plain
Content-Encoding:

7bit


------------------------------------------------------------------------
config.def

Content-Type:

text/plain
Content-Encoding:

7bit




reply via email to

[Prev in Thread] Current Thread [Next in Thread]