[Ohrrpgce] SVN: teeemcee/8148 Fix android builds segfaulting. ndk-build was compiling filelayer.cpp wi

Ralph Versteegen teeemcee at gmail.com
Tue Sep 13 04:37:18 PDT 2016


Turns out iterator operators are fully documented, I just missed the link
to the page: http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgOpStep
Since you need to give a start and end range, which are of the same type as
the iterator variable, it's not really usable for implementing for-each
loops, unless you want to use C++ style container.begin()...container.end()
ranges (yuck). Better to just add a "next" method to a container or
generator class and use a while loop.

I did notice that FB is missing one overloadable operator: there's no
'call' operator.

On 13 September 2016 at 04:11, Ralph Versteegen <teeemcee at gmail.com> wrote:

> Great!
>
> I haven't picked carefully through all of the changelog (I've been
> ignoring it for the last 6 years while we were stuck on FB 0.22), but the
> other highlights seem to be:
>
> -Operator overloading. All operators are overloadable, including LET
> (assignment to existing instance) and CAST (including implicit conversions
> to another type!*), OPERATOR NEW and NEW[], and OPERATOR[], and even stuff
> you wouldn't expect like ABS, SGN, COS, INT, EQV, unary * and ->, and FOR,
> NEXT, STEP. The later are for iterators but don't seem to be properly
> documented yet. (I also forgot FB had IMP and EQV operators). I will look
> into reimplementing vector as a class. Also, note that we can define a CAST
> to string operator.
> -You can pass string BYVAL now
> -"Any function result may now be ignored at the call site (simply by not
> using the function result in any expression or assignment). Previously this
> was only allowed for functions returning integer types or pointers."
> -Lots of support added for using anonymous/temporary object created by
> calling the constructor (or TYPE<typename>(...)) in various circumstances
> - "dim byref x as foo = ..." which is creates a reference (ie a pointer),
> like byref arguments, and equivalent to "foo &x = ..." in C++. Basically,
> this is an alternative to WITH with an explicit name, which allows nesting,
> which is something I frequently want to do. Actually, I think you can nest
> WITH anyway, and use ..fieldname to refer two levels up.
> -0.18.2 already added "support for multiple assignments: 'LET( foo, bar,
> ... ) = UDT_expression'".
> -PRIVATE, PROTECTED, PUBLIC, VIRTUAL, ABSTRACT
> -FB now seems to implement most of C++98 except for templates, multiple
> inheritance and exceptions (not counting the C++ standard library). I
> believe it's actually ABI compatible, meaning you can use a C++ class from
> FB and vice versa. That would be quite useful for reimplementing vector as
> a class, for example. Or exposing a C++ implementation of a hashmap to FB
> to replace our own.
>
> Also, FB has had type inference (VAR instead of DIM) for a long time now.
> Our decision to stick to DIM seems to be partially for style and partially
> due to unawareness.
>
> * See http://www.freebasic.net/wiki/wikka.php?wakka=ProPgDataConversion
> In fact, there's a whole "Programmers Guide" section of the wiki I've
> never looked at before: http://www.freebasic.net/wiki/wikka.php?wakka=
> CatPgProgrammer
> FB is now a pretty large language.
>
> On 13 September 2016 at 02:22, James Paige <Bob at hamsterrepublic.com>
> wrote:
>
>> I'll try to get all the nightly build boxes moved over to fb 1.04 or
>> newer this week.
>>
>> ---
>> James
>>
>> On Sat, Sep 10, 2016 at 9:48 AM, Ralph Versteegen <teeemcee at gmail.com>
>> wrote:
>>
>>> Yes, you will need to append that last line. Wow, I didn't realise
>>> android builds have been broken for so long!
>>>
>>> Actually, we are really close to being able to compile libapplication.so
>>> for android directly from scons; even fbc can now produce working android
>>> binaries directly. Another option would be to compile it with ndk-build
>>> ourselves (which is easy, because we already have the necessary .mk files
>>> provided by the commandergenius port). Plus with Chrono/Kevin's
>>> ohrrpgce-android packager (which compiles the java code), the only thing we
>>> would need commandergenius for is to compile libsdl.so. But, it's probably
>>> not worth the effort of changing our build system much just for that;
>>> letting people create .apks themselves would be nice though.
>>>
>>> Also, I have been working on some major changes to the sconscript, so
>>> that it can do general cross-compiling instead of just supporting android
>>> as a special case. To actually use it you would need a cross-compiling
>>> toolchain, and unfortunately I don't know if it's even possible to set one
>>> up to target OSX, but I think all other platforms are easy.
>>>
>>> You can now get FB 1.06 for android, see http://rpg.hamsterrepublic.com
>>> /ohrrpgce/Compiling_for_Android
>>> So, I can now start using modern FB features. Inheritance! Polymorphism!
>>> Runtime type checking! Properties! Dynamic arrays in UDTs! Length zero
>>> arrays! It looks like FB 1.00 was the first to have all of those, but
>>> requiring FB 1.04 is a good target, since it made a lot of significant
>>> changes, including retranslating most headers, which made supporting 1.04
>>> and 1.03 simultaneously painful.
>>>
>>>
>>> On 10 September 2016 at 06:18, James Paige <Bob at hamsterrepublic.com>
>>> wrote:
>>>
>>>> Awesome! I just tested and it is working great now. Thank you so much
>>>> for fixing this!
>>>>
>>>> Am I correct to guess that I will need to apply the changes to
>>>> AndroidAppSettings.cfg to all the copies of that file that I have for each
>>>> different game that has been compiled as a standalone apk?
>>>>
>>>> ---
>>>> James
>>>>
>>>>
>>>> On Fri, Sep 9, 2016 at 9:42 AM, <subversion at hamsterrepublic.com> wrote:
>>>>
>>>>> teeemcee
>>>>> 2016-09-09 09:42:00 -0700 (Fri, 09 Sep 2016)
>>>>> 411
>>>>> Fix android builds segfaulting. ndk-build was compiling filelayer.cpp
>>>>> without -DFBCVERSION.
>>>>>
>>>>> This causes the wrong struct definitions to get used for FB internals.
>>>>> Broken since OPENFILE added in r9000.
>>>>>
>>>>> It wasn't just -DFBCVERSION, all CFLAGS were omitted. They are now
>>>>> included
>>>>> by android/AndroidAppSettings.cfg.
>>>>> This means that the level of optimisation selected with scons debug=#
>>>>> now affects android builds.
>>>>> ---
>>>>> U   wip/SConscript
>>>>> U   wip/android/AndroidAppSettings.cfg
>>>>> U   wip/fb/fb_stub.h
>>>>> U   wip/ohrbuild.py
>>>>> _______________________________________________
>>>>> Ohrrpgce mailing list
>>>>> ohrrpgce at lists.motherhamster.org
>>>>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Ohrrpgce mailing list
>>>> ohrrpgce at lists.motherhamster.org
>>>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Ohrrpgce mailing list
>>> ohrrpgce at lists.motherhamster.org
>>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>>
>>>
>>
>> _______________________________________________
>> Ohrrpgce mailing list
>> ohrrpgce at lists.motherhamster.org
>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20160913/d59d75bd/attachment-0001.htm>


More information about the Ohrrpgce mailing list