Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
98 user(s) are online (79 user(s) are browsing Forums)

Members: 2
Guests: 96

Raziel, AlfredOne, more...

Support us!

Headlines

Report message:*
 

Re: Porting to AmigaOS4 thread

Subject: Re: Porting to AmigaOS4 thread
by Raziel on 2020/11/21 15:25:18

@Capehill
@jabirulo

Boy, this compiler is picky

I managed to move around stuff so i get it to build without warnings, thanks a lot for the help

Now i'd like to implement the utf8 stuff (noob here aswell) but MorpHOS seems to use some stuff that is not available, or maybe i hvaenßt found it in the SDK (yet)?

This is the codesets part i have in now
#if defined(__amigaos4__) && defined(USE_SYSDIALOGS)

#include "backends/dialogs/amigaos/amigaos-dialogs.h"

#include "common/config-manager.h"
#include "common/encoding.h"

#include <libraries/codesets.h>

#include <proto/asl.h>
#include <proto/dos.h>
#include <proto/exec.h>

char *AmigaOSDialogManager::utf8ToLocal(char *in) {

    if (!
in) {
        return 
strdup("");
    }

    
struct Library *CodesetsBase IExec->OpenLibrary("codesets.library"6);
    if (
CodesetsBase) {

        
LONG dstmib CSA_DestCodeset(NULL0);
        if (
dstmib != CS_MIBENUM_INVALID) {
            
LONG dstlen FSGetByteSize((APTR)in, -1CS_MIBENUM_UTF_8dstmib);
            
char *out = (char *)malloc(dstlen 1);
            if (
out) {
                if (
ConvertTagList((APTR)in, -1, (APTR)out, -1CS_MIBENUM_UTF_8dstmibNULL) != -1) {
                    return 
out;
                }
                
free(out);
            }
        }
        
IExec->CloseLibrary(CodesetsBase);
    }

    return 
strdup(in);
}
...

But i get compiler errors and warnings...do i miss an include, maybe?

Especially FSGetByteSize and ConvertTagList seem to be nowhere in my SDK.

And what does that "expression cannot be used as function" mean?

C++      backends/dialogs/amigaos/amigaos-dialogs.o
backends
/dialogs/amigaos/amigaos-dialogs.cppIn member function 'char* AmigaOSDialogManager::utf8ToLocal(char*)':
backends/dialogs/amigaos/amigaos-dialogs.cpp:52:40errorexpression cannot be used as function
   
LONG dstmib CSA_DestCodeset(NULL0);
                                        ^
backends/dialogs/amigaos/amigaos-dialogs.cpp:54:18error'FSGetByteSize' was not declared in this scope
    LONG dstlen 
FSGetByteSize((APTR)in, -1CS_MIBENUM_UTF_8dstmib);
                  ^~~~~~~~~~~~~
backends/dialogs/amigaos/amigaos-dialogs.cpp:54:18notesuggested alternative'FSGetFileSize'
    
LONG dstlen FSGetByteSize((APTR)in, -1CS_MIBENUM_UTF_8dstmib);
                  ^~~~~~~~~~~~~
                  
FSGetFileSize
backends
/dialogs/amigaos/amigaos-dialogs.cpp:57:9error'ConvertTagList' was not declared in this scope
     
if (ConvertTagList((APTR)in, -1, (APTR)out, -1CS_MIBENUM_UTF_8dstmibNULL) != -1) {
         ^~~~~~~~~~~~~~
backends/dialogs/amigaos/amigaos-dialogs.cpp:57:9notesuggested alternative'convertMsg'
     
if (ConvertTagList((APTR)in, -1, (APTR)out, -1CS_MIBENUM_UTF_8dstmibNULL) != -1) {
         ^~~~~~~~~~~~~~
         
convertMsg
backends
/dialogs/amigaos/amigaos-dialogs.cppIn member function 'virtual Common::DialogManager::DialogResult AmigaOSDialogManager::showFileBrowser(const Common::U32String&, Common::FSNode&, bool)':
backends/dialogs/amigaos/amigaos-dialogs.cpp:93:56warningcast from type 'const value_type*' {aka 'const char*'to type 'char*' casts away qualifiers [-Wcast-qual]
   
char *newTitle utf8ToLocal((char *)utf8Title.c_str());
                                                        ^
gmake: *** [backends/dialogs/amigaos/amigaos-dialogs.oError 1


Thanks for all the help guys, really appreciated...not that i'll learn much from it, but, yeah

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project