Re: [hatari-devel] Patch for CAPS5 better support

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 14/08/2018 à 14:46, Azamat Hackimov a écrit :
I'm afraid, that not optimal solution for package distribution. Commontypes.h is spsdeclib package's file, and I as maintainer of hatari package not allowed to change external package.
I think I can do some #ifdef CAPS5 and define these types inside hatari.


I know, I worked with SPS to improve 4.2 and release 5.1 in the case of WD1772.

But in that case, I really think it's an error in the sources as they were released ; I already discussed this, as well as a few others things that could be improved, with SPS guys but they are busy on other things at the moment and they don't have time to provide some updated sources.

Short summary is that capslib 5.1 so far is not ready to be used directly, it requires some patching and I don't think the changes should be made in Hatari.

Nicolas

вт, 14 авг. 2018 г., 15:38 Nicolas Pomarède <npomarede@xxxxxxxxxxxx <mailto:npomarede@xxxxxxxxxxxx>>:

    Le 14/08/2018 à 00:28, Troed Sångberg a écrit :
     > Nicolas,
     >
     > This was a problem on Mac as well. I needed to get a diff from
    you that added these types to be able to compile.
     >

    Hi

    you're right, I forgot about this one :)
    It seems SPS forgot to define the Capsxxx types and the patch is needed
    to correct Commontypes.h

    Azamat, can you try to apply this patch to your version of
    Commontypes.h
    too ?

    Nicolas

     > tmbpr:hatari troed$ cat caps.diff
     > --- /home/npomarede/CAPSImage.framework/Headers/CommonTypes.h
    2014-08-11 20:34:12.000000000 +0200
     > +++ ./CommonTypes.h   2014-07-01 00:13:39.000000000 +0200
     > @@ -2,9 +2,17 @@
     >   #define COMMONTYPES_H
     >
     >   //-- Linux changes
     > -typedef int8_t BYTE;
     > -typedef int16_t WORD;
     > -typedef int32_t DWORD;
     > +#ifndef __cdecl
     > +#define __cdecl
     > +#endif
     > +
     > +typedef uint8_t BYTE;
     > +typedef uint16_t WORD;
     > +typedef uint32_t DWORD;
     > +
     > +typedef uint8_t  CapsUByte;
     > +typedef int32_t  CapsLong;
     > +typedef uint32_t CapsULong;
     >   //-- Linux changes
     >
     >   typedef void *PVOID;
     >
     >
     > /Troed
     >
     >
     >
     >
     > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
     > On August 13, 2018 11:44 PM, Azamat Hackimov
    <azamat.hackimov@xxxxxxxxx <mailto:azamat.hackimov@xxxxxxxxx>> wrote:
     >
     >> Hello.
     >>
     >> I downloaded CAPS5 from
     >> http://www.kryoflux.com/download/spsdeclib_5.1_source.zip and
    there no
     >> Caps[U]long types in headers.
     >>
     >> When I try to compile with it I got these errors (with my patch it
     >> compiles and runs fine):
     >>
     >> [ 69%] Building C object src/CMakeFiles/hatari.dir/hd6301_cpu.c.o
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:64:2: error:
     >> unknown type name 'CapsLong'
     >> CapsLong CapsImage[ MAX_FLOPPYDRIVES ]; /* Image Id or -1 if
    drive empty */
     >> ^~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:65:2: error:
     >> unknown type name 'CapsLong'
     >> CapsLong CapsImageType[ MAX_FLOPPYDRIVES ]; /* ImageType or -1
    if not known */
     >> ^~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:86:53:
    error:
     >> unknown type name 'CapsULong'
     >> static void IPF_CallBack_Trk ( struct CapsFdc *pc , CapsULong
    State );
     >> ^~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:87:53:
    error:
     >> unknown type name 'CapsULong'
     >> static void IPF_CallBack_Irq ( struct CapsFdc *pc , CapsULong
    State );
     >> ^~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:88:53:
    error:
     >> unknown type name 'CapsULong'
     >> static void IPF_CallBack_Drq ( struct CapsFdc *pc , CapsULong
    State );
     >> ^~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c: In function
     >> 'IPF_MemorySnapShot_Capture':
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:170:26:
    error:
     >> 'IPF_CallBack_Irq' undeclared (first u
     >> se in this function)
     >> IPF_State.Fdc.cbirq = IPF_CallBack_Irq;
     >> ^~~~~~~~~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:170:26:
    note:
     >> each undeclared identifier is reported
     >> only once for each function it appears in
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:171:26:
    error:
     >> 'IPF_CallBack_Drq' undeclared (first u
     >> se in this function); did you mean 'IPF_CallBack_Irq'?
     >> IPF_State.Fdc.cbdrq = IPF_CallBack_Drq;
     >> ^~~~~~~~~~~~~~~~
     >> IPF_CallBack_Irq
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:172:26:
    error:
     >> 'IPF_CallBack_Trk' undeclared (first u
     >> se in this function); did you mean 'IPF_CallBack_Drq'?
     >> IPF_State.Fdc.cbtrk = IPF_CallBack_Trk;
     >> ^~~~~~~~~~~~~~~~
     >> IPF_CallBack_Drq
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c: In
    function 'IPF_Init':
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:386:24:
    error:
     >> 'IPF_CallBack_Irq' undeclared (first u
     >> se in this function)
     >> IPF_State.Fdc.cbirq = IPF_CallBack_Irq;
     >> ^~~~~~~~~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:387:24:
    error:
     >> 'IPF_CallBack_Drq' undeclared (first u
     >> se in this function); did you mean 'IPF_CallBack_Irq'?
     >> IPF_State.Fdc.cbdrq = IPF_CallBack_Drq;
     >> ^~~~~~~~~~~~~~~~
     >> IPF_CallBack_Irq
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:388:24:
    error:
     >> 'IPF_CallBack_Trk' undeclared (first u
     >> se in this function); did you mean 'IPF_CallBack_Drq'?
     >> IPF_State.Fdc.cbtrk = IPF_CallBack_Trk;
     >> ^~~~~~~~~~~~~~~~
     >> IPF_CallBack_Drq
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c: In function
     >> 'IPF_Insert':
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:422:2:
    error:
     >> unknown type name 'CapsLong'
     >> CapsLong ImageId;
     >> ^~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:423:2:
    error:
     >> unknown type name 'CapsLong'
     >> CapsLong ImageType;
     >> ^~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:483:55:
    error:
     >> 'CapsULong' undeclared (first use in t
     >> his function)
     >> if ( CAPSLockImageMemory ( ImageId , pImageBuffer ,
     >> (CapsULong)ImageSize , DI_LOCK_MEMREF ) == imgeOk )
     >> ^~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:483:65:
    error:
     >> expected ')' before 'ImageSize'
     >> if ( CAPSLockImageMemory ( ImageId , pImageBuffer ,
     >> (CapsULong)ImageSize , DI_LOCK_MEMREF ) == imgeOk )
     >> ^~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:483:7:
    error:
     >> too few arguments to function 'CAPSLock
     >> ImageMemory'
     >> if ( CAPSLockImageMemory ( ImageId , pImageBuffer ,
     >> (CapsULong)ImageSize , DI_LOCK_MEMREF ) == imgeOk )
     >> ^~~~~~~~~~~~~~~~~~~
     >> In file included from /usr/include/caps5/CapsLibAll.h:9:0,
     >> from /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:33:
     >> /usr/include/caps5/CapsLib.h:21:15: note: declared here
     >> ExtSub SDWORD CAPSLockImageMemory(SDWORD id, PUBYTE buffer, UDWORD
     >> length, UDWORD flag);
     >> ^~~~~~~~~~~~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c: At top
    level:
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:716:53:
    error:
     >> unknown type name 'CapsULong'
     >> static void IPF_CallBack_Trk ( struct CapsFdc *pc , CapsULong
    State )
     >> ^~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:745:53:
    error:
     >> unknown type name 'CapsULong'
     >> static void IPF_CallBack_Irq ( struct CapsFdc *pc , CapsULong
    State )
     >> ^~~~~~~~~
     >> /home/winterheart/playground/hg/hatari/src/floppy_ipf.c:764:53:
    error:
     >> unknown type name 'CapsULong'
     >> static void IPF_CallBack_Drq ( struct CapsFdc *pc , CapsULong
    State )
     >> ^~~~~~~~~
     >> make[2]: *** [src/CMakeFiles/hatari.dir/build.make:519:
     >> src/CMakeFiles/hatari.dir/floppy_ipf.c.o] Error 1
     >> make[2]: *** Waiting for unfinished jobs....
     >> make[1]: *** [CMakeFiles/Makefile2:167:
    src/CMakeFiles/hatari.dir/all] Error 2
     >> make: *** [Makefile:141: all] Error 2
     >>
     >> вс, 12 авг. 2018 г. в 23:39, Nicolas Pomarède
    npomarede@xxxxxxxxxxxx <mailto:npomarede@xxxxxxxxxxxx>:
     >>
     >>> Le 12/08/2018 à 00:25, Azamat Hackimov a écrit :
     >>>
     >>>> Hello.
     >>>> I'm working on porting Hatari 2.1.0 to one of Linux
    distributives. Here
     >>>> patch with changes, that fixes some build failures with CAPS5
    library
     >>>> (or spsdeclib in my distribution).
     >>>
     >>> Hi
     >>> I'm rot really sure about your patch bein required ; caps lib
    5.1 was
     >>> released in june 2014 (I worked on this with the SPS guys) and this
     >>> version uses Caps[U]long, they were not dropped.
     >>> Maybe it's in your linux distrib that they modified the headers
    ? But
     >>> that's not how it was released upstream, and Hatari compile
    fines with
     >>> caps lib 5.1.
     >>> Nicolas
     >>
     >> --
     >>
     >>  From Siberia with Love!
     >
     >
     >







Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/