What does Far mean in c?

前端 未结 3 626
一向
一向 2021-01-04 03:16
const struct sockaddr FAR* name,
3条回答
  •  既然无缘
    2021-01-04 04:20

    If does nothing unless you happen to be using a 16 bit x86 compiler.

    If you look in the Win32 header WinDef.h (in Visual Studio, simply right-click the word FAR in the source and select "Go to Definition", you will see that it is a macro defined as far, which in turn is also a macro defined as nothing at all!

    It is only there to allow the compilation of legacy Win16 source as Win32. In 16 bit x86 compilers, far was a compiler extension keyword to support seg::offset pointers which resolve to a 20bit address (16 bit x86 only had a 1Mb address space!). They are distinct from 16 bit near pointers which comprised only the ::offset from the current segment.

提交回复
热议问题