English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 11 July 2020, 13:11   #1
ciVic
Registered User
 
Join Date: Oct 2013
Location: Germany
Posts: 39
MUI and GCC >3

Hi all,

For my project I have to use a newer GCC. It compiled on OS 3 (with 2.95.3), OS 4 and MorphOS. However, using something newer than 3 leads to various errors. Using 6.5.0b I get:

Code:
m68k-amigaos-gcc -I"." -I"../include" -I"../../AmiSSL/Developer/include" -Wno-write-strings  -m68020 -MMD -c ../main.c -o main.o
../main.c:299: unterminated macro call
../main.c:497: unterminated macro call
...
Using 3.4.6:

Code:
../main.c:497:2: unterminated argument list invoking macro "MUI_NewObject"
../main.c: In function `main':
../main.c:299: error: syntax error at end of input
It seems that this does not work anymore (and then very likely everything else also):

Code:
app = ApplicationObject, End;
Does somebody know what's going on here? Obviously the old headers (e.g. inline/muimaster.h) cannot work anymore because of the inline assembler. The compiler have their own header for MUI but I cannot find a doc for that.

Last edited by ciVic; 11 July 2020 at 13:17.
ciVic is offline  
Old 26 December 2022, 10:45   #2
BSzili
old chunk of coal
 
BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 1,289
In case someone else runs into this problem, I was able to work it around with this stub:
Code:
#undef MUI_NewObject
Object *MUI_NewObject(CONST_STRPTR classname, Tag tag1, ...)
{
	return MUI_NewObjectA(classname, (struct TagItem*)&tag1);
}
There's some compatibility issue with GCC inline macros and MUI's way of stitching functions together with multiple macros.
BSzili is offline  
Old 29 December 2022, 18:08   #3
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by BSzili View Post
In case someone else runs into this problem, I was able to work it around with this stub:
Code:
#undef MUI_NewObject
Object *MUI_NewObject(CONST_STRPTR classname, Tag tag1, ...)
{
    return MUI_NewObjectA(classname, (struct TagItem*)&tag1);
}
There's some compatibility issue with GCC inline macros and MUI's way of stitching functions together with multiple macros.

Using amiga-gcc and installing the mui SDK
Code:
make sdk=mui
should work out of the box.
bebbo is offline  
Old 30 December 2022, 08:02   #4
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Quote:
Originally Posted by ciVic View Post
Hi all,

For my project I have to use a newer GCC. It compiled on OS 3 (with 2.95.3), OS 4 and MorphOS. However, using something newer than 3 leads to various errors. Using 6.5.0b I get:

Code:
m68k-amigaos-gcc -I"." -I"../include" -I"../../AmiSSL/Developer/include" -Wno-write-strings  -m68020 -MMD -c ../main.c -o main.o
../main.c:299: unterminated macro call
../main.c:497: unterminated macro call
...
Using 3.4.6:

Code:
../main.c:497:2: unterminated argument list invoking macro "MUI_NewObject"
../main.c: In function `main':
../main.c:299: error: syntax error at end of input
It seems that this does not work anymore (and then very likely everything else also):

Code:
app = ApplicationObject, End;
Does somebody know what's going on here? Obviously the old headers (e.g. inline/muimaster.h) cannot work anymore because of the inline assembler. The compiler have their own header for MUI but I cannot find a doc for that.
Are you trying to use C headers in C++? If so, you need extern "C" all over the place to deactivate name mangling. GCC 3 had a different name mangling scheme than GCC 2. On Haiku 32-bit we run into that bug all the time because the shared object files are stored in name mangled C++ written for BeOS in GCC 2.x.
Samurai_Crow is offline  
Old 30 December 2022, 09:13   #5
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by Samurai_Crow View Post
Are you trying to use C headers in C++? If so, you need extern "C" all over the place to deactivate name mangling. GCC 3 had a different name mangling scheme than GCC 2. On Haiku 32-bit we run into that bug all the time because the shared object files are stored in name mangled C++ written for BeOS in GCC 2.x.

It's rather because of the inline macros. With these you need to define
Code:
#define NO_INLINE_STDARG
#define NO_INLINE_VARARGS
since the macros don't support nesting.
bebbo is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basics of gcc MartinW Coders. C/C++ 10 15 January 2020 14:33
gcc .lib mritter0 Coders. C/C++ 13 27 October 2018 02:13
gcc and cybergraphics zeGouky Coders. C/C++ 3 20 November 2016 04:08
GCC problems Minuous Coders. C/C++ 3 08 September 2016 16:16
Horizontal Group Has Content Partially Hidden in MUI v4, Not MUI v3.8a tygre support.Apps 6 29 February 2016 03:27

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:31.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07012 seconds with 15 queries