delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/11/20/14:02:04

From: Radical DOT NetSurfer AT delorie DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP: S_ISDIR() ?????
Date: Tue, 20 Nov 2001 13:54:34 -0500
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <nh9lvt0l86tc16qlcrthud9a2gf5jiaje6@4ax.com>
References: <0rqivtk7vhhprds46r1a48o07rvp82isuc AT 4ax DOT com>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
X-Complaints-To: newsabuse AT supernews DOT com
Lines: 67
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Since I wanted to #ifdef BorlandC around da problem,
obviously I am looking for the 'borland' equivalent
of S_ISDIR()....issue turned out to be trivial anyways.

NEW PROBLEM:

which is better to use:

#ifdef __DJGPP__

...or...

#ifdef __GNUC__

in that someone who wants to compile for Linux GCC and not just
MSDOS/DJGPP, is GNUC acceptable?
I haven't yet encountered msdos DJ-specific issues conflicting with
LinuxGCC-compiling.

THANKS!

On Mon, 19 Nov 2001 15:34:12 -0500, Radical NetSurfer wrote:

>I have a program that is meant by its designer to be compiled 
>in both DJGPP and Borland (etc.) compilers...
>
>however, he's using 'S_ISDIR()' which I have never seen before,
>DJGPP libc.txt  (2.95.3) gives some "vague" information under
>
>int ftw(const char *dir,
>        int (*func)(const char *path, struct stat *stbuf, int flag),
>        int depth);
>-------- and ------------
>int stat(const char *file, struct stat *sbuf);
>-------- and ------------
>sys/stat.h   
>
>#define S_ISDIR(m)	(((m) & 0xf000) == 0x3000)
>
>====== Borlands   sys\stat.h  (16.32-bit) ========
>gives this information:
>
>/* Traditional names for bits in st_mode.
> */
>#define S_IFDIR  0x4000  /* directory */
>
>#if defined(__FLAT__)
>/* POSIX file type test macros.  The parameter is an st_mode value.
> */
>#define S_ISDIR(m)  ((m) & S_IFDIR)
>
>=============================================
>
>Can someone offer some input on this so I can properly
>#ifdef BORLANDC
>myself around this problem?
>
>Also, I'd like an approach that would indicate if
>"16-bit" or "FLAT" model compiles are attempted.
>
>Eegads... my work is cut out for me isn't it....LOL.??
>
>//RadSurfer//
>
>email: radsmail AT juno DOT com
>

- Raw text -


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