When attempting to build the excellent MicroC library (thread, download) on Mac OS 10.5, I am dumped at a MaxIDE editor window with the file microc.bmx.debug.macosx.x86.s opened to the first line with this error message:
The first few lines look like this:
It would appear that the first two are using a syntax not supported by the Mac OS assembler.
The only place (in this file) where QueryPerformanceCounter@4 or _QueryPerformanceFrequency@4 are referenced is:
This function is declared in the file Shared.bmx.
This appears to use a windows-only extern. I can patch this, however the error behavior in this case is very, very confusing. The compiler should stop in the BMX file and indicate that an unsupported Extern is being used.
Compile Error Rest of line ignored. 1st junk character valued 64 (@).
The first few lines look like this:
.reference _QueryPerformanceCounter@4 .reference _QueryPerformanceFrequency@4 .reference ___bb_basic_basic .reference ___bb_blitz_blitz .reference ___bb_retro_retro .reference ___bb_system_system
It would appear that the first two are using a syntax not supported by the Mac OS assembler.
The only place (in this file) where QueryPerformanceCounter@4 or _QueryPerformanceFrequency@4 are referenced is:
_binphx_microc_HPMillisecs: push %ebp mov %esp,%ebp sub $24,%esp movl %ebp,4(%esp) movl $_17395,(%esp) calll *_bbOnDebugEnterScope movl $_17385,(%esp) calll *_bbOnDebugEnterStm movl $_17387,(%esp) calll *_bbOnDebugEnterStm movl $_17389,(%esp) calll *_bbOnDebugEnterStm movl $0,12(%esp) movl $0,8(%esp) movl _17386+4,%eax movl %eax,4(%esp) movl _17386,%eax movl %eax,(%esp) call _bbLongSeq cmp $0,%eax je _17390 movl %ebp,4(%esp) movl $_17393,(%esp) calll *_bbOnDebugEnterScope movl $_17391,(%esp) calll *_bbOnDebugEnterStm lea _17386,%eax movl %eax,(%esp) call _QueryPerformanceFrequency@4 movl $_17392,(%esp) calll *_bbOnDebugEnterStm lea _17388,%eax movl %eax,(%esp) call _QueryPerformanceCounter@4 calll *_bbOnDebugLeaveScope
This function is declared in the file Shared.bmx.
Rem _ ___ /\/\ (_) ___ _ __ ___ / __\ / \| |/ __| '__/ _ \ / / / /\/\ \ | (__| | | (_) / /___ \/ \/_|\___|_| \___/\____/ MicroC Copyright (C) 2008 Binary Phoenix - All Rights Reserved This software is designed to provide a simple, efficient and easy to integrate scripting language in a limited syntantic form similar to the C language. If you have any suggestions for new features To be added To this module please contact me at BinaryPhoenix.com, Or helios4ever@gmail.com. Notes: - This source file just contains a number of general purpose functions that are used by all source files. Change Log: Version 1.0 - File Created. End Rem Rem Couple of external functions used in this source file. End Rem Extern "win32" Function QueryPerformanceCounter(count:Long Var) Function QueryPerformanceFrequency(freq:Long Var) End Extern Rem Returns the index of the object within the given list. End Rem Function ListIndexOf:Int(list:TList, obj:Object) Local index:Int = 0 For Local check:Object = EachIn list If (check = obj) Then Return index index :+ 1 Next Return -1 End Function Rem Returns the index of the object within the given array. End Rem Function ArrayIndexOf:Int(list:Object[], obj:Object) Local index:Int = 0 For Local check:Object = EachIn list If (check = obj) Then Return index index :+ 1 Next Return -1 End Function Rem No, it has nothing to do with HP sauce ;). It mearly wraps the high preformance timer of the OS so we can get more accurate timing. Returns the current milliseconds since the computer started up, within the accuracy of the given OS's internal clock. End Rem Function HPMillisecs:Float() Global frequency:Long = 0 Global start:Long = 0 If (frequency = 0) QueryPerformanceFrequency(frequency) QueryPerformanceCounter(start) EndIf ?win32 Local time:Long QueryPerformanceCounter(time) Return (Double(time - start) / Double(frequency)) * 1000.0 ? Return MilliSecs() End Function
This appears to use a windows-only extern. I can patch this, however the error behavior in this case is very, very confusing. The compiler should stop in the BMX file and indicate that an unsupported Extern is being used.