如何解决expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
源代码如下:
#ifndef _DB_H_
#define_DB_H_
#ifndef __NO_SYSTEM_INCLUDES
#include <sys/types.h>
#include <stdio.h>
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#undef__P
#if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER)
#define__P(protos)protos/* ANSI C prototypes */
#else
#defineconst
#define__P(protos)()/* K&R C preprocessor */
#endif
#ifndef__BIT_TYPES_DEFINED__
#define__BIT_TYPES_DEFINED__
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
#endif
#ifdef WIN32
typedef long int32_t;
typedef int ssize_t;
typedef unsigned long u_long;
typedef unsigned int u_int;
#endif
#defineDB_VERSION_MAJOR3
#defineDB_VERSION_MINOR2
#defineDB_VERSION_PATCH9
#defineDB_VERSION_STRING"Sleepycat Software: Berkeley DB 3.2.9: (January 24, 2001)"
typedefu_int32_tdb_pgno_t;/* Page number type. */
typedefu_int16_tdb_indx_t;/* Page offset type. */
#defineDB_MAX_PAGES0xffffffff/* >= # of pages in a file */
typedefu_int32_tdb_recno_t;/* Record number type. */
#defineDB_MAX_RECORDS0xffffffff/* >= # of records in a tree */
在编译时一直出现这样的错误,error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’求助各位大侠帮忙分析下原因,谢谢!
[解决办法]
#if defined(__cplusplus)
extern "C" {
#endif
这个括弧{的下半部分在哪儿??
是不是最后还要有个
#if defined(__cplusplus)
}
#endif
[解决办法]