我有两个文件如下。
ppnfs_mutex.h
...
struct ppnfs_mutex_t
{
pthread_mutex_t mutex;
pthread_t owner;
const char* context;
};
...
ppnfs_mutex.cc
#define PPNFS_MUTEX_INITIALIZER \
{ .mutex = PTHREAD_MUTEX_INITIALIZER, .owner = 0, .context = NULL, }
struct ppnfs_mutex_t ppnfs_metadata_mutex = PPNFS_MUTEX_INITIALIZER; // line 6
我g++
用来编译这个文件,有一个错误信息:
ppnfs_mutex.cc:6:47: error: expected primary-expression before ‘.’ token
代码有什么问题?