New cmcat...
Anoq of the Sun
anoq@HardcoreProcessing.com
Wed, 17 Oct 2001 11:06:05 +0200
This is a multi-part message in MIME format.
--------------0D53832CA04E84343F4A7DFD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello!
I added support for the -Dflag option for cmcat, which will
define the preprocessor symbol 'flag' to 0.
I've also added it to my 20010831 patch to
your MLton version 1999-07-12 here:
http://www.HardcoreProcessing.com/pro/mltonwin32/mltonwin32_19990712.html
I use:
cmcat -DMLton_cmcat sources.cm > out
Instead of -DMLton - becuase I assume that when
compiling .cm files directly with MLton, the
structure MLton will be defined - in which
case the test would be:
#if defined(structure MLton)
It's just to avoid any potential nameclashes - and
to allow me to sometime change my makefiles to compile
the .cm files directly with MLton...
Anyway - I hope it's useful :)
Cheers
--
http://www.HardcoreProcessing.com
--------------0D53832CA04E84343F4A7DFD
Content-Type: application/x-unknown-content-type-sml_auto_file;
name="cmcat.sml"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="cmcat.sml"
KCogY21jYXQgdGFrZXMgYSAiLmNtIiBmaWxlIGFzIGlucHV0IGFuZCBwcm9kdWNlcyBhbiBTTUwg
cHJvZ3JhbSBhcyBvdXRwdXQuCiAqIEl0IHRha2VzIGFsbCBvZiB0aGUgZmlsZXMgaW4gdGhlIGdy
b3VwIChhbmQgc3ViZ3JvdXBzKSBhbmQgb3V0cHV0cyB0aGVpcgogKiBjb250ZW50cyBpbiB0aGUg
bGluZWFyIG9yZGVyIGRlZHVjZWQgYnkgQ00uIAogKgogKiBjbWNhdCBkb2VzIG5vdCB1bmRlcnN0
YW5kIHRoZSBleHBvcnQgZmlsdGVycyB1c2VkIGJ5IENNLiAgSGVuY2UsIHRoZSByZXN1bHRpbmcK
ICogcHJvZ3JhbSBtYXkgbm90IGJlIHZhbGlkIFNNTCBhbmQgbWF5IHJlcXVpcmUgbWFudWFsIHJl
bmFtaW5nIG9mIHNvbWUgbW9kdWxlcy4KICoKICogQmVjYXVzZSBvZ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ItRCIgZmxhZyB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBkZWZpbmVzIDo9IChTdHJpbmcuc3Vic3RyaW5nIChmbGFnLCAyLCBzaXplIGZs
YWcgLSAyKSkgOjogKCFkZWZpbmVzKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVs
c2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpZSAoImludmFsaWQgZmxhZyIg
XiBmbGFnKQoJCQkJIDsgbG9vcCBhcmdzKQoJCSAgICAgfCBfID0+IGRpZSAid3JvbmcgbnVtYmVy
IG9mIGFyZ3VtZW50cyIKCSAgICAgIGluIGxvb3AgYXJncwoJICAgICAgZW5kKSkpCiAgIGVuZAo=
--------------0D53832CA04E84343F4A7DFD--