At the risk of re-incurring the Rath of Dave, might I suggest simply taking
the existing working functional free c++ runtime libraries from either
numega or my websites? How many times do we need to re-invent this wheel?
Meanwhile… it sounds a lot like you may have somehow created a visual C++
project within which you are attempting to compile this ‘additions.c’ file.
This would be a bad, perhaps even evil, thing. Instead you want to build
your file using the DDK build tools. If you find the DDK build tools less
than useful, you might try looking at the various alternatives, but I don’t
really want to open that rat’s nest either. Well I do, but not now. (See my
website again about ‘ddkbuild’.)
Finally, if you are attempting to provide new and delete operators that will
link with your C++ code you probably ought to use a .cpp extension for
starters, and you need to use the crufty microsoft __cdecl syntax:
void __cdecl operator new(size_t size)
{
// your code goes here (hint ExAllocate…)
}
void __cdecl operator delete(void * pVoid)
{
// your code goes here (ExFree(…)
}
Note that if you prepend __inline to each of these functions then you don’t
even need a source file, a ‘.h’ file will suffice.
My versions of new allow for all sorts of useful options like pool tagging,
pool specifiers, and placement new for those pesky existing data objects.
They even provide the old standby malloc and free for those unix people who
just can’t unlearn bad habits.
Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
603 321 1032
WindowsNT Windows 2000 Consulting Services
-----Original Message-----
From: John Hirschi [mailto:xxxxx@SonicWALL.com]
Sent: Wednesday, April 04, 2001 2:57 PM
To: NT Developers Interest List
Subject: [ntdev] Loser newbie question
On everyone’s seemingly unanimous advice, I am writing substitutes for
the new and delete operators. However, when I try to compile this new
file in, I get this error : “addition.c(11) : error C1010: unexpected
end of file while looking for precompiled header directive”. I’m not
including anything!
I know this is an easy one, someone clue me in please…
Thanks,
John
You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com