AHI includes differences for c/c++

10 posts / 0 new
Last post
kas1e
kas1e's picture
Offline
Last seen: 3 months 4 days ago
Joined: 2010-11-30 15:30
AHI includes differences for c/c++

Have simple test case:

  1. #define __USE_INLINE__
  2.  
  3. #include <proto/ahi.h>
  4.  
  5. main()
  6. {
  7. AHI_AllocAudio(0,0,0,0,0,0,TAG_DONE);
  8. }

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:

  1. #define AHI_AllocAudioA(tagList) IAHI->AHI_AllocAudioA(tagList)
  2. #if !defined(__cplusplus) && (__STDC_VERSION__ >= 199901L || __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
  3. #define AHI_AllocAudio(...) IAHI->AHI_AllocAudio(__VA_ARGS__)
  4. #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

xenic
xenic's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2011-05-07 04:52
@kas1e I checked my new OS4

@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

salass00
salass00's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-02-03 11:27
@kas1e That must be

@kas1e

That must be generated by an older idltool because with current one varargs inline4 macros are done like this:

  1. #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3)
  2. #define FbxSetupFSTags(msg, ops, opssize, ...) IFileSysBox->FbxSetupFSTags((msg), (ops), (opssize), __VA_ARGS__)
  3. #elif (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
  4. #define FbxSetupFSTags(msg, ops, opssize, vargs...) IFileSysBox->FbxSetupFSTags(msg, ops, opssize, ## vargs)
  5. #endif
kas1e
kas1e's picture
Offline
Last seen: 3 months 4 days ago
Joined: 2010-11-30 15:30
@Xenic I do not know from

@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


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

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


That must be generated by an older idltool because with current one varargs inline4 macros are done like this:

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.

kas1e
kas1e's picture
Offline
Last seen: 3 months 4 days ago
Joined: 2010-11-30 15:30
@Xenic SDK:Include/interface

@Xenic


SDK:Include/interfaces/ahi.xml

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.

xenic
xenic's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2011-05-07 04:52
@kas1e I double checked my

@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

kas1e
kas1e's picture
Offline
Last seen: 3 months 4 days ago
Joined: 2010-11-30 15:30
@Xenic Right, i a bit mess it

@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:


ram:>fdtrans ahi.sfd -x
ram:>idltool -i -n -p ahi.xml

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

kas1e
kas1e's picture
Offline
Last seen: 3 months 4 days ago
Joined: 2010-11-30 15:30
d

d

xenic
xenic's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2011-05-07 04:52
@kas1e In case you are not

@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

salass00
salass00's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-02-03 11:27
@xenic The source code in

@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.

Log in or register to post comments