For a while ive been using "extrn", then i heard its better to use "extrndef". So i changed all my extrns to extrndefs, but i get syntax errors. This is how i use extrn....

extrn     label:type


Where label is some label and type is byte if its a string or dword if its a dword. So i changed it to

extrndef     label:type


But i get errors. Is there some other way im supposed to use it?

Second question...
In C there is something like
if window.inc is not included

include it
else
dont include it


Is there anything like this in masm?
Posted on 2001-11-14 20:59:12 by ChimpFace9000
Sometimes, like in DX8 - the includes are wraped in IFNDEF/ENDIF statements to make sure they aren't processed twice, but there is no way to check if a file of a paticular name has been included. Here is an example:
IFNDEF _WIN_INCLUDE_

_WIN_INCLUDE_ EQU 0
;the rest of the file here...

ENDIF
As for EXTERNDEF, look at the NMAKE example in the other thread for it's usuage.
Posted on 2001-11-14 21:37:57 by bitRAKE
its "externdef", not "extrndef"
Posted on 2001-11-15 02:28:20 by japheth
Oh, whoops. Now it works, thanks.
Posted on 2001-11-15 04:24:46 by ChimpFace9000
Why is "externdef" better than "extrn"?
Posted on 2001-11-15 08:00:30 by dxantos
I think it has to do with EXTERNDEF only requiring the symbol if it
is actually used (unlike EXTERN, which will yank in the symbol anyway).
But I might be very wrong :). I remember I found out the reason
while working on my protoize tool, but... geez, sometimes I am afraid
I might have alzheimer.
Posted on 2001-11-15 08:04:11 by f0dder
Yes, f0dder, you are right (not with Alz I hope :) ). Whats more, if the "externdef" symbol is defined in the current modul, it automatically becomes "public". So externdef is best suited for header files.
Posted on 2001-11-15 09:42:58 by japheth