gc.c

ANOQ of the Sun anoq@hardcoreprocessing.com
Wed, 07 Jun 2000 00:14:46 +0200


This is a multi-part message in MIME format.
--------------60CF9B43359D7D7915089395
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello!


Here's my new gc.c. The flag is called DONT_SHRINK_MEM
and is always set for Win32. All my printf's have
been removed.

I can now run my application with all 3 input
files on Win32 without problems :)
So everything seems to work perfectly now.

Thanks a lot for all the help!


Cheers
-- 
http://www.HardcoreProcessing.com


--------------60CF9B43359D7D7915089395
Content-Type: application/x-unknown-content-type-ProjectBuilder.c;
 name="gc.c"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="gc.c"

LyogQ29weXJpZ2h0IChDKSAxOTk3LTE5OTkgTkVDIFJlc2VhcmNoIEluc3RpdHV0ZS4KICogUGxl
YXNlIHNlZSB0aGUgZmlsZSBMSUNFTlNFIGZvciBsaWNlbnNlIGluZm9ybWF0aW9uLgogKi8KCiNp
bmNsdWRlICJnYy5oIgoKI2lmIGRlZmluZWQoX1dJTjMyKQojaW5jbHVkZSA8d2luZG93cy5oPgoj
aW5jbHVkZSA8c3lzL3RpbWViLmg+CgovLyBPbiBXaW4zMiwgd2UgY2Fubm90IGZyZWUgb25seSBw
YXJ0IG9mIGEgbWVtb3J5IGFyZWEuCi8vIFRoaXMgZmVhdHVyZSBvZiBtdW5tYXAgaXMgdXNlZCB3
aGVuIHNocmlua2luZyBtZW1vcnkKLy8gYXJlYXMgKHRoZSBoZWFwIGFuZCB0aGUgc3RhY2spLCBz
byB3ZSBzaG91bGRuJ3Qgc2hyaW5rCi8vIGFueXRoaW5nIG9uIFdpbjMyLgojZGVmaW5lIERPTlRf
U0hSSU5LX01FTSAxCgovLyBJIF90aGlua18gdGhpcyBpcyBjb3JyZWN0IC0gaXQncyBzb21lIGNv
bnN0YW50cyBmcm9tIERlbHBoaS4uLgoKI2lmbmRlZiBfU0hfREVOWVJECiNkZWZpbmUgX09fUkRP
TkxZIDAKI2Rl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