Compare commits

...

5 Commits

Author SHA1 Message Date
Wolfgang Thaller 1ed09307a7
Merge pull request #235 from agoode/cpp
Define "macintosh" and "Macintosh"
2024-04-12 09:29:11 -06:00
Wolfgang Thaller 99de31d45a
Merge pull request #240 from agoode/flush
Call FlushVol on close()
2024-04-11 22:25:44 -06:00
Adam Goode 5157624174 Call FlushVol on close()
This is recommended by Inside Macintosh.
2024-04-11 17:48:22 -04:00
Adam Goode 05a3f397e1 Update to latest multiversal 2024-04-11 17:48:18 -04:00
Adam Goode 085ef7e333 Define "macintosh" and "Macintosh"
See https://sourceforge.net/p/predef/wiki/OperatingSystems/.
2024-03-18 21:47:22 -04:00
5 changed files with 22 additions and 6 deletions

View File

@ -21,11 +21,11 @@
"multiversal": {
"flake": false,
"locked": {
"lastModified": 1703617805,
"narHash": "sha256-GngLWR9i+hC7hJ+ZkKlRK4K63lIJ4D/CMXZwefcVAqw=",
"lastModified": 1712682701,
"narHash": "sha256-/bHk7tU3+xxIs4YGLUyJVG9RsVO23ek41R//eO1F22Q=",
"owner": "autc04",
"repo": "multiversal",
"rev": "27c08c654bbd48d23f025741e3a584b59374904a",
"rev": "32dff28d1d618972cc2f544c86ee017b6464fa89",
"type": "github"
},
"original": {

View File

@ -16,3 +16,11 @@
#undef CPP_SPEC
#define CPP_SPEC "-Wno-trigraphs"
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("macintosh"); \
builtin_define ("Macintosh"); \
} \
while (0)

View File

@ -152,6 +152,8 @@
builtin_define ("__PPC__"); \
builtin_define ("__POWERPC__"); \
builtin_define ("__NATURAL_ALIGNMENT__"); \
builtin_define ("macintosh"); \
builtin_define ("Macintosh"); \
builtin_assert ("system=macos"); \
builtin_assert ("cpu=powerpc"); \
builtin_assert ("machine=powerpc"); \

View File

@ -135,8 +135,14 @@ int _open_r(struct _reent *reent, const char* name, int flags, int mode)
int _close_r(struct _reent *reent, int fd)
{
if(fd >= kMacRefNumOffset)
FSClose(fd - kMacRefNumOffset);
if(fd >= kMacRefNumOffset) {
short refNum = fd - kMacRefNumOffset;
short vRefNum;
OSErr err = GetVRefNum(refNum, &vRefNum);
FSClose(refNum);
if (err == noErr)
FlushVol(NULL, vRefNum);
}
return 0;
}

@ -1 +1 @@
Subproject commit 27c08c654bbd48d23f025741e3a584b59374904a
Subproject commit 32dff28d1d618972cc2f544c86ee017b6464fa89