File: 
 
[RetroPC.NET] / 
np2 / 
macosx / 
macossub.cpp
 Revision 
1.6: 
download - view: 
text, 
annotated - 
select for diffs
Mon Jan 12 01:58:47 2004 JST (21 years, 9 months ago) by 
tk800
Branches: 
MAIN
CVS tags: 
VER_0_82_x64,
VER_0_82,
VER_0_81A,
VER_0_81,
VER_0_80,
VER_0_79,
VER_0_78,
VER_0_77,
VER_0_76,
VER_0_75,
VER_0_74,
VER_0_73,
HEAD
fix for Panther[MacOSX] (tk800)
#include	"compiler.h"
#include	<time.h>
#ifndef NP2GCC
#ifdef TARGET_API_MAC_CARBON
#include	<CFString.h>
#endif
#endif
void macossub_init(void) {
}
void macossub_term(void) {
}
UINT32 macos_gettick(void) {
	UnsignedWide current;
	Microseconds(¤t);
	return((UINT32)((current.hi * 4294967) + (current.lo / 1000)));
}
// ---- code
void mkstr255(Str255 dst, const char *src) {
	int		len;
	len = strlen(src);
	if (len >= 255) {
		len = 255;
	}
	dst[0] = (BYTE)len;
	if (len) {
		CopyMemory((char *)dst+1, src, len);
	}
}
void mkcstr(char *dst, int size, const Str255 src) {
	if ((src != NULL) && (dst != NULL) && (size > 0)) {
		size--;
		size = min(size, src[0]);
		if (size) {
			CopyMemory(dst, src + 1, size);
		}
		dst[size] = '\0';
	}
}
RetroPC.NET-CVS <cvs@retropc.net>