Have simple test case:
#define __USE_INLINE__ #include <proto/ahi.h> main() { AHI_AllocAudio(0,0,0,0,0,0,TAG_DONE); }
With gcc all compiles fine:
ram:> ppc-amigaos-gcc -c test.c
With g++ have errors:
ram:> ppc-amigaos-g++ -c test.c
test.c: In function 'int main()':
test.c:9: error: 'AHI_AllocAudio' was not declared in this scope
Do check sdk/include/include_h/inline4/ahi.h and found:
#define AHI_AllocAudioA(tagList) IAHI->AHI_AllocAudioA(tagList) #if !defined(__cplusplus) && (__STDC_VERSION__ >= 199901L || __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) #define AHI_AllocAudio(...) IAHI->AHI_AllocAudio(__VA_ARGS__) #endif
Questions is:
1. why it disabled for c++
2. how to fix them normally and make it works as i need without change to AHI_AllocAudioA()
Thanks
@kas1e
I checked my new OS4 SDK and my previous OS4 SDK. There is no SDK:include/include_h/inline4/ahi.h file. Nor is there a SDK:Include/interfaces/ahi.xml which could be used to create the missing file. I don't see any autodocs for AHI either. You should probably ask the person who created your AHI files about the _cplusplus exception in the AHI inline4 include file.
Also, I don't think "AHI_AllocAudio(0,0,0,0,0,0,TAG_DONE);" is going to work anyway but I could be wrong. Since TAG_DONE is defined as zero ( 0 ) your function call has the same effect as "AHI_AllocAudio(TAG_DONE);". I think AHI_AllocAudioA((struct TagItem *)NULL) would be the same as calling AHI_AllocAudio() without any tags.My interpretation of the old AHI autodocs is that some tags are required.
If you have any influence with ssolie, you might ask him to update the AHI includes in the public SDK and add the missing files.
X1000 - OS 4.1FE
@kas1e
That must be generated by an older idltool because with current one varargs inline4 macros are done like this:
@Xenic
I do not know from where i got my ones, probably there (can't check at moment): http://os4depot.net/index.php?function=showcontent&file=development/library/audio/ahidev.lha
Yep, it will not work, i just show it like this to point on compilation problem with c++ (it happens with bunch of ahi functions), but real live code of course done right.
@salas00
I checked ahidev from os4depot and its 2005, so pretty much possible. I assume we need to ask Steven or to just regenerate new ahi includes and add it directly to SDK, or just reupload new archive on os4depot.
@Xenic
Are you sure you didn't have that file ? I found that in 53.24, but yep, there is no inlin4/ahi.h, and with ahi includes in build with SDK, we just have errors about GetInterface and DropInterface, etc once we trying to use c++ over it. And in whole it looks like was generated by some very old idltool (even older than those includes on os4depot).
I also ask Steven about, and he says that yep, ahi should be inbuild with SDK. Just seems its need rebuild with new idtool.
@Fredrik
I create BZ to SDK about rebuild an ahi includes with newer idltools, maybe you can have a look at this if you have time for of course.
@kas1e
I double checked my SDK and the original install archive for 53.24 but there is no SDK:Include/interfaces/ahi.xml file included. Maybe your copy was added from another source.
X1000 - OS 4.1FE
@Xenic
Right, i a bit mess it all, there no xml , just an include_h/interfaces/ahi.h.
Anyway i just rebuild it all for now by simple downloading ahidev and grab ahi.sfd from:
Ready to use archive can be get there till its not in SDK (if anyone need it):
http://kas1e.mikendezign.com/aos4/ahidev_new_os4.zip
d
@kas1e
In case you are not aware of it, the latest AHI dev kit I know of is at http://arp2.berlios.de/ahi/
and also has info on the AHI source repository. SInce the ahi.device on OS4.1 is v 6.6, there may be minor changes for OS4 that are not in that repository.
X1000 - OS 4.1FE
@xenic
The source code in BerliOS SVN (svn://svn.berlios.de/arp2/ahi/ahisrc/branches/BRANCH_6) is for ahi.device 6.7 so it should be the newest version.