balloonwj / flamingo

flamingo 一款高性能轻量级开源即时通讯软件

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

编译时报错,静态断言.怎么搞...

gchihiha opened this issue · comments

报错:
flamingoserver/base/fileutil.cpp:89:2: error: static assertion failed: sizeof(off_t) not 8
static_assert(sizeof(off_t) == 8, "sizeof(off_t) not 8");
我用的是卡片机,大概得改源码才行了吧.

@gchihiha 使用static_assert是为了在编译期间尽早发现问题。这里使用这个的意思是:off_t的定义是long,也就是要求long型占8个字节,也就是要求程序运行在64位系统上。不过这个函数目前没用到,你如果是32位系统的话可以把这行代码注释掉试试。