Oxygen Basic

Programming => Problems & Solutions => Topic started by: Emil_halim on March 16, 2013, 08:46:37 AM

Title: C Combatability
Post by: Emil_halim on March 16, 2013, 08:46:37 AM
Hi all ,

I have a Zlib.h header file , so the next line is not understood by OxyGen, any help?
Code: [Select]
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));

it gave this Error
Quote
ERROR:
unknown type
WORD:    voidpf

LINE:    77
FILE:    zlib.h

Edited:

 BTW i have the next code in a header file that included in zLib.h , but seems Oxygen did not see it.
Code: [Select]
#ifdef STDC
   typedef void const *voidpc;
   typedef void FAR   *voidpf;
   typedef void       *voidp;
#else
   typedef Byte const *voidpc;
   typedef Byte FAR   *voidpf;
   typedef Byte       *voidp;
#endif
Title: Re: C Combatability
Post by: Emil_halim on March 16, 2013, 09:45:55 AM

Have an other Error

consider the following code in c language.
Code: [Select]
#ifndef FAR
#  define FAR
#endif

...
.....
...... and later

  typedef Byte       FAR      Bytef;
                     ^^^
                        |
                this is ok with c 
                but not with Oxygen

the FAR  term is nothing by deceleration  (#define FAR) , so when parse the last line (typedef Byte  FAR   Bytef) it must be like that (typedef Byte  Bytef)

Oxygen give this error
Quote
ERROR:
'FAR' is already defined
WORD:    Byte
LINE:    264
FILE:    zconf.h
 
Title: Re: C Combatability
Post by: Charles Pegge on March 16, 2013, 01:01:19 PM
Code: [Select]
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));

It gets thrown by the OF word
Is there a definition of OF?

Code: [Select]
#ifndef far
# define far
#endif

typedef byte far bytef
bytef b

print sizeof b

I have a fix for this situation.

Oxygen does not have a separate preprocessor layer like C. This has advantages, like the ability to  create scoped/localised macros, but gets us into trouble with C headers which plonk macros in strange places.  ::)

Title: Re: C Combatability
Post by: Emil_halim on March 17, 2013, 12:07:02 PM
Quote
It gets thrown by the OF word
Is there a definition of OF?

no the problem was something belong C directives i.e #case sensitive ........

Quote
I have a fix for this situation.

hope to see it  :)

Quote
Oxygen does not have a separate preprocessor layer like C. This has advantages, like the ability to  create scoped/localised macros, but gets us into trouble with C headers which plonk macros in strange places.

i have a simple idea , make a new directive for preprocessor stuff , so that it will be 100% compatible with
C , or it will be as it already is , what do you think ?

BTW the fast , easy and  short way for achieving certain things with Oxygen Basic is attractive me to this
great language. :)   
Title: Re: C Combatability
Post by: JRS on March 17, 2013, 12:21:12 PM
Quote
BTW the fast , easy and  short way for achieving certain things with Oxygen Basic is attractive me to this
great language.

Strange why others can't see the obvious that O2 is probably the most relevant version of Basic available. (followed by ScriptBasic of course ...  :) )
Title: Re: C Combatability
Post by: Emil_halim on March 18, 2013, 07:42:34 AM
John,

I think Oxygen Basic needs a good help Files and variable difficult tutorials these will demonstrate the power
and advantage of Oxygen Basic.   
Title: Re: C Combatability
Post by: Aurel on March 18, 2013, 08:02:47 AM

Quote
I think Oxygen Basic needs a good help Files and variable difficult tutorials these will demonstrate the power
and advantage of Oxygen Basic.   
I agree...currently is very confusing from people outside to figure what is what .
Title: Re: C Combatability
Post by: Charles Pegge on March 18, 2013, 09:28:29 AM

Quote
i have a simple idea , make a new directive for preprocessor stuff , so that it will be 100% compatible with
C , or it will be as it already is , what do you think ?

Yes, I seem to be heading in that direction. We could preprocess  all the #defines first, and it may not require a separate C switch. Oxygen has its own set of dynamic macro constructs as well.

With regard to tutorials, I hope these will emerge eventually from all the examples we have accumulated.

Charles
Title: Re: C Combatability
Post by: Emil_halim on March 18, 2013, 10:18:42 AM
Code: [Select]
We could preprocess  all the #defines first, and it may not require a separate C switch. Oxygen has its own set of dynamic macro constructs as well.

I think that will be the best solution here , No more Directives .......
Title: Re: C Combatability
Post by: Charles Pegge on March 18, 2013, 07:37:58 PM
Case sensitivity is a potential problem.

#case capital is useful for handling fully capitalised words, treating all others as case insensitive.
Title: Re: C Combatability
Post by: Haim on March 19, 2013, 01:42:18 AM
Hi,
A tutorial will be very welcome... :)
Haim
Title: Re: C Combatability
Post by: Charles Pegge on March 19, 2013, 02:39:46 AM
I would like to see something like a code database, with hypelinks giving easy access to all the examples.  All my man-hours at present are spent on development.
Title: Re: C Combatability
Post by: Emil_halim on March 22, 2013, 12:06:38 AM

Hi Charles ,

Quote
We could preprocess  all the #defines first, and it may not require a separate C switch

is there any progress here?

Emil.   
Title: Re: C Combatability
Post by: Emil_halim on April 11, 2013, 09:34:18 AM

Hay any body home?
Title: Re: C Combatability
Post by: Charles Pegge on April 11, 2013, 10:14:21 AM
This is an intricate operation. I need a lots of spare time to go through this.
Title: Re: C Combatability
Post by: Emil_halim on April 27, 2013, 07:54:37 AM
Hi Charles,

if you please , take that into your considerations.

i am waiting becouse i tried to compile Zlib written  in c with Oxygen , so the first problem was acting of
#define.

thanks again for your oxygen effort.   
Title: Re: C Combatability
Post by: Charles Pegge on April 27, 2013, 08:09:08 AM
Slowly getting there. I have a clearer picture now about what needs to be done for C preprocessor compatibility.

Though we will still have to deal with potential name/symbol conflicts.
Title: Re: C Combatability
Post by: Emil_halim on August 15, 2013, 01:39:22 PM
Quote
I have a clearer picture now about what needs to be done for C preprocessor compatibility.

when can this Picture born and come to the life?

i think you forgot this topic.

BTW , why your country force United Nations to take action against us,we are fitting a terrorism her.
Title: Re: C Combatability
Post by: JRS on August 15, 2013, 07:42:24 PM
Maybe terrorists are smarting up and realize antagonizing countries with unlimited resources is counter productive so they are adopting the big fish in a small pond strategy. I'm hoping with time the fad wears off and people will find other ways to work out their differences. (paint balls, chess, ...)



Title: Re: C Combatability
Post by: Aurel on August 15, 2013, 09:29:14 PM
Quote
BTW , why your country force United Nations to take action against us,we are fitting a terrorism her.
This is programming forum and really i don't see reason for such a political questions,right?
Title: Re: C Combatability
Post by: Emil_halim on August 15, 2013, 10:30:42 PM
Maybe terrorists are smarting up and realize antagonizing countries with unlimited resources is counter productive so they are adopting the big fish in a small pond strategy. I'm hoping with time the fad wears off and people will find other ways to work out their differences. (paint balls, chess, ...)

John,

the Fact here is that the matter is not a differences between people, it is a real terrorism came from small amount of Armed group against unarmed people and State enterprises. i think your government did not seeing that well.

Note well , The police and the army deal gently with them and they are dealing terrorizing citizens
Title: Re: C Combatability
Post by: JRS on August 15, 2013, 10:35:31 PM
In our country they are known as the mob, family, ...
Title: Re: C Combatability
Post by: Charles Pegge on August 16, 2013, 12:53:44 PM

Hi Emil,

the C preprocessor is on my list. I have not forgotten, but it will have to wait till I have sufficient time/energy to deal with the fairly major structural changes that are required.

Under the current macro system, only headers with complex macros are likely to be misinterpreted. Are there any header issues currently affecting your projects?

Title: Re: C Combatability
Post by: JRS on August 16, 2013, 01:06:56 PM
That is where I understood the C include option stood. After the FreeImage header translation enhancement, I took it as you would look as C header issues as a as needed basis. Asking if Jose Roca's include files could be used may have been asking too much.



Title: Re: C Combatability
Post by: Emil_halim on August 19, 2013, 07:57:47 AM
Hi Charles,

Quote
Under the current macro system, only headers with complex macros are likely to be misinterpreted. Are there any header issues currently affecting your projects?

till now the only error i had is hierarchic header problem. i think modifying oxygen basic is not big deal when
changing #define directive to handle hierarchic header stuff.     
Title: Re: C Combatability
Post by: JRS on August 19, 2013, 10:41:42 AM
Emil,

Would you be willing to take the lead with the C/C++ header file support with O2? I think the best way to test the header include functionality is try importing some of the common used libraries and see what blows up. The FreeImage headers was one of those unexpected deals where the function names in the include didn't match the name in the DLL.

I think it's easier on Charles when he is working with team leader to move things along rather than getting blasted by a bunch of whining forum members that have their own agenda.

John