Author Topic: C Combatability  (Read 6359 times)

0 Members and 1 Guest are viewing this topic.

Emil_halim

  • Guest
C Combatability
« 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
« Last Edit: March 16, 2013, 09:01:33 AM by Emil_halim »

Emil_halim

  • Guest
Re: C Combatability
« Reply #1 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
 

Charles Pegge

  • Guest
Re: C Combatability
« Reply #2 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.  ::)


Emil_halim

  • Guest
Re: C Combatability
« Reply #3 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. :)   

JRS

  • Guest
Re: C Combatability
« Reply #4 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 ...  :) )

Emil_halim

  • Guest
Re: C Combatability
« Reply #5 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.   

Aurel

  • Guest
Re: C Combatability
« Reply #6 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 .

Charles Pegge

  • Guest
Re: C Combatability
« Reply #7 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

Emil_halim

  • Guest
Re: C Combatability
« Reply #8 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 .......

Charles Pegge

  • Guest
Re: C Combatability
« Reply #9 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.

Haim

  • Guest
Re: C Combatability
« Reply #10 on: March 19, 2013, 01:42:18 AM »
Hi,
A tutorial will be very welcome... :)
Haim

Charles Pegge

  • Guest
Re: C Combatability
« Reply #11 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.

Emil_halim

  • Guest
Re: C Combatability
« Reply #12 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.   

Emil_halim

  • Guest
Re: C Combatability
« Reply #13 on: April 11, 2013, 09:34:18 AM »

Hay any body home?

Charles Pegge

  • Guest
Re: C Combatability
« Reply #14 on: April 11, 2013, 10:14:21 AM »
This is an intricate operation. I need a lots of spare time to go through this.