The first one can be replace using the HIGH(MyArray); that returns the number of addressable elements in the array...You mean Length?
Please help. I'm creating binding for this library.You've already gotten helpful responses but, I wanted to point something out. With the exception of the NELEMS(a), those macros will not be used in data definitions which means you don't need to translate them unless you're also porting the C code to Pascal.
p/s: I think I could skip this header, but I don't know if other headers depend on it would break or not.
Please help. I'm creating binding for this library.You've already gotten helpful responses but, I wanted to point something out. With the exception of the NELEMS(a), those macros will not be used in data definitions which means you don't need to translate them unless you're also porting the C code to Pascal.
p/s: I think I could skip this header, but I don't know if other headers depend on it would break or not.
It seems the only macro you need to concern yourself with is the NELEMS(a) macro and, even that one, it's more likely being used in code than in a data definition (though, it could be used in another data definition but, that case is somewhat rare.)
In a few words, correctly converting headers from C to Pascal requires a reasonable level of familiarity with C and Pascal. Otherwise, you'll spend time converting things you don't even need in the target language (Pascal in this case.)
Please help. I'm creating binding for this library.You've already gotten helpful responses but, I wanted to point something out. With the exception of the NELEMS(a), those macros will not be used in data definitions which means you don't need to translate them unless you're also porting the C code to Pascal.
p/s: I think I could skip this header, but I don't know if other headers depend on it would break or not.
It seems the only macro you need to concern yourself with is the NELEMS(a) macro and, even that one, it's more likely being used in code than in a data definition (though, it could be used in another data definition but, that case is somewhat rare.)
In a few words, correctly converting headers from C to Pascal requires a reasonable level of familiarity with C and Pascal. Otherwise, you'll spend time converting things you don't even need in the target language (Pascal in this case.)
In the original code, they do. He used them through out his library. At least it's what I think. I'm not sure, either. I will ask him. But he didn't reply to my two previous mails. The only thing I could do is waiting.
If you have a C compiler like gnu installed, you can use cpp -E which will expand the macros, then examine the output on how those macro's are expanded to sourcecode.
Using them inside the library and using them in code that uses the library is two different things. Normally libraries separate those headers into private/internal and public ones however.
If you have a C compiler like gnu installed, you can use cpp -E which will expand the macros, then examine the output on how those macro's are expanded to sourcecode.
I tried. It will just omit all of the macros I wanted to translate.
If you have a C compiler like gnu installed, you can use cpp -E which will expand the macros, then examine the output on how those macro's are expanded to sourcecode.
I tried. It will just omit all of the macros I wanted to translate.
The macros will only be expanded in locations they are used at, not by themselves. The result of cpp -E is that simply no more preprocessor directives exist anymore and it's a plain C/C++ source now (with all files included).