delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/01/05/15:37:56

Date: Tue, 5 Jan 1999 15:37:51 -0500
Message-Id: <199901052037.PAA15120@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp-workers AT delorie DOT com
CC: djgpp-workers AT delorie DOT com
In-reply-to: <199901052034.VAA22741@father.ludd.luth.se> (message from Martin
Str|mberg on Tue, 5 Jan 1999 21:34:48 +0100 (MET))
Subject: Re: stubs?
References: <199901052034 DOT VAA22741 AT father DOT ludd DOT luth DOT se>
Reply-To: djgpp-workers AT delorie DOT com

> > stubs are only needed when a non-ansi/posix function is called from
> > one of libc's ansi/posix functions.  Other functions do not pollute
> > the ansi/posix namespaces, so do not need stubs.
> 
> Like my proposed functions _get_fs_type() and _get_fat_size()?

Right.  They don't need stubs.  The leading underscores are a
different issue completely.  Note that stubs aren't needed when the
called function doesn't violate the namespace; for example, your
functions have underscores, which make them "ansi-safe", so no stubs
would be needed even if some ansi function called them.  Stubs are
usually needed for cases where ansi functions call posix functions,
like fopen() calling open(), where the names of both functions are
defined by specs, but there are still namespace pollution problems.
In those cases, we stub the posix function, have the ansi one call the
real function (__open()), and the stub (open()) also calls the real
function (__open()).  That way, the ansi function never actually calls
the function with the polluting name (which would be the stub), it
always calls a namespace-safe function (the real one, which now has
underscores).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019