Skip to content

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

Description

@xiangpdu

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))

Activity

  1. awwit commented on Aug 2, 2018

    @awwit
    Owner

    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.

  2. added and removed on Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions