unitpoint / objectscript

ObjectScript, OS for short, is a new programming language. It's free, cross-platform, lightweight, embeddable and open-source. It combines the benefits of multiple languages, including: JavaScript, Lua, Ruby, Python and PHP. OS features the syntax of Javascripts, the "multiple results" feature from lua, syntactic shugar from Ruby as well as magic methods from PHP and Ruby - and even more!
http://objectscript.org
Other
70 stars 19 forks source link

Some OS X fixes #34

Closed IngwiePhoenix closed 10 years ago

IngwiePhoenix commented 10 years ago

Hey. Currently i am compiling on OS X, and I get a few errors. Those are rather simple:

objectscript.cpp:13206:17: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                        if(candidate = gc_candidate_values.get(OS_VALUE_VARIANT(value).value->value_id)){
                           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
objectscript.cpp:13206:17: note: place parentheses around the assignment to silence this warning
                        if(candidate = gc_candidate_values.get(OS_VALUE_VARIANT(value).value->value_id)){
                                     ^
                           (                                                                           )
objectscript.cpp:13206:17: note: use '==' to turn this assignment into an equality comparison
                        if(candidate = gc_candidate_values.get(OS_VALUE_VARIANT(value).value->value_id)){
                                     ^
                                     ==
1 warning generated.
Ingwie@Ingwies-Air ~/Work/objectscript $ g++ os.cpp src/obj/*.o -I src/obj -Isrc -o os
os.cpp:574:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                while(ok = compileLine()){
                      ~~~^~~~~~~~~~~~~~~
os.cpp:574:12: note: place parentheses around the assignment to silence this warning
                while(ok = compileLine()){
                         ^
                      (                 )
os.cpp:574:12: note: use '==' to turn this assignment into an equality comparison
                while(ok = compileLine()){
                         ^
                         ==
os.cpp:629:20: error: use of undeclared identifier 'environ'
                        initEnv("_ENV", environ);
                                        ^
1 warning and 1 error generated.

For the Last, I will look for a fix. But for the malloc thing:

#ifndef __APPLE__
#include <malloc.h>
#else
#include <malloc/malloc.h>
#endif

Kind regards! ^_^

unitpoint commented 10 years ago

Let's try to add:

extern char **environ;

P.S. found it here https://rt.cpan.org/Public/Bug/Display.html?id=80272

IngwiePhoenix commented 10 years ago

I found that as well, so at roughly L629, I just added that. Here is how it looks on my end:

        }
        if(args[has_E]){  /* option '-E'? */
#if 0
            char * environ[] = {NULL};
            initEnv("_ENV", environ);
#endif
        }else{
            extern char* environ[]; // L629
            initEnv("_ENV", environ);
        }

After that, it compiled. Okay, I still get a lot of warnings, but those are quite minor. :)

unitpoint commented 10 years ago

fixed

IngwiePhoenix commented 10 years ago

Cool :) Am Mo. Feb. 03 2014 08:57:12 schrieb Evgeniy Golovin:

fixed

— Reply to this email directly or view it on GitHub.