typedef char FAR charf

Started by
2 comments, last by sprite_hound 14 years, 1 month ago
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...)
Advertisement
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.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
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.
Ah. Thanks for the replies!

This topic is closed to new replies.

Advertisement