typedef char FAR charf
I realise this is a basic question, but what does typedef char FAR charf; typedef int FAR intf; //... actually mean. FAR is simply #define FAR.
(This is in zconf.h from zlib...)
That's a relict from the times of 16bit memory models. The zlib dates back to those days, so it needed to support weird things such like different pointer types for different address ranges. Today it's not necessary anymore (thus it's defined empty as you cited). You can safely ignore it.
Some older systems used to use segmented addressing.
Ane example was some of the older 16 bit Intel processors. You could address memory inside a segment using so called "near" pointers (16 bit addresses). To address memory between segments you would need a "far" pointer (which was effectively a 20 bit pointer constructed from two 16 bit values).
On such systems, FAR could be #defined to some compiler-specific way of annotating far pointers.
Ane example was some of the older 16 bit Intel processors. You could address memory inside a segment using so called "near" pointers (16 bit addresses). To address memory between segments you would need a "far" pointer (which was effectively a 20 bit pointer constructed from two 16 bit values).
On such systems, FAR could be #defined to some compiler-specific way of annotating far pointers.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement