C++ sizeof type different in library and calling c

2019-09-05 02:42发布

I use C++ library in cocoa application. And I call C++ library code from macos application C++ code. I run into problem that Client class in library returns

sizeof Client 976

but in Mac OS application I have

sizeof Client 944

Client class https://github.com/eiskaltdcpp/eiskaltdcpp/blob/master/dcpp/Client.h

Why is that?

1条回答
Evening l夕情丶
2楼-- · 2019-09-05 03:02

After comparetion of Client classes i went to it parent class and found that one member (CriticalSection) of parent class (Speaker) cause this difference of size.

In header of this file i found that because of not defined macros Mac OS application use different definition of this class(CriticalSection) which cause difference of size.

查看更多
登录 后发表回答