delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/08/31/09:47:34

Message-ID: <3f51fb97$0$164$cc7c7865@news.luth.se>
From: Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se>
Subject: Re: as and structs
Newsgroups: comp.os.msdos.djgpp
References: <3f3e2079$0$168$cc7c7865 AT news DOT luth DOT se> <bhlib8$9g8$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <3f3e4fcf$0$172$cc7c7865 AT news DOT luth DOT se> <bhlk4i$arr$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
User-Agent: tin/1.4.6-20020816 ("Aerials") (UNIX) (NetBSD/1.6Q (alpha))
Date: 31 Aug 2003 13:43:51 GMT
Lines: 36
NNTP-Posting-Host: speedy.ludd.luth.se
X-Trace: 1062337431 news.luth.se 164 130.240.16.13
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote:
: Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se> wrote:
:> source then? E. g. DEBUG in my example.

:> :> 1.  What should I do to make this work nicely with prototypes and
:> :> structs in header files?

:> : Enclose the C-only parts in some #ifdef, e.g. #ifdef __GNUC__ or
:> : whatever.

:> Which define makes a good C<->assembly discriminator? __GNUC__?

: I should think so.  'gcc -v' on both a .c and a .S file should
: enlighten this further.

Thanks. This is what I did.

Case 1, some code for DJGPP libc. A sed script that extracted the
relevant #defines into a local header file (thank you, Richard Dawe)
and use the created header file in the .S files. 

Case 2, my own pet project. Surround the structs with #ifdef __GNUC__
and #endif (there's only one 32bit header file with this and it's
automatically generated as a glue file between 16bit djasm code
and 32bit code).

: That expectation would be quite wrong, though.  The choice of flags
: depends on the source language (via the file extension), not the
: program being called to translate them.

Ok. Thanks!


Right,

						MartinS

- Raw text -


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