httpserver icon indicating copy to clipboard operation
httpserver copied to clipboard

The global scope :: doesn't works fine for a function which is a #define

Open xiangpdu opened this issue 7 years ago • 1 comments

Such as:

src/server/protocol/ServerHttp2.cpp:501:63: error: expected unqualified-id *reinterpret_cast<uint32_t *>(addr + sizeof(uint32_t) ) = ::htonl( ^ /usr/include/sys/_endian.h:136:18: note: expanded from macro 'htonl' #define htonl(x) __DARWIN_OSSwapInt32(x) ^ /usr/include/libkern/_OSByteOrder.h:75:5: note: expanded from macro '__DARWIN_OSSwapInt32' (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt32(x) : _OSSwapInt32(x))

xiangpdu avatar Aug 01 '18 15:08 xiangpdu

I know that for macros does not work global scope ::

It's a pity that in MacOS these functions are declared as macros. I did not know that. I do not have a device with MacOS to adapt the program for this operating system.

awwit avatar Aug 02 '18 11:08 awwit