[antlr-interest] Antlr3 C Runtime Improvement Patches

Bot Tiger bottiger1 at gmail.com
Sun Feb 1 11:38:00 PST 2009


Dear Jim,

I don't know about the strdup, but for compiling as C, it was at that
setting already when I loaded up the project.

I am using Visual Studio 2008 Version 9.0.21022.8 RTM with SP1 and hotfixes
up to KB953256.

I am fairly certain that those patches for compiling as STDCALL instead of
CDECL are required, because when I switched the compilier to STDCALL, those
places were attempting to cast a STDCALL function to a CDECL function
pointer.


On Sun, Feb 1, 2009 at 8:56 AM, Jim Idle <jimi at temporal-wave.com> wrote:

> Bot Tiger wrote:
>
>> Here are some patches to get the antlr3 C runtime to compile as STDCALL.
>>
>
> Shouldn't be. Are you trying to compile the runtime as C++? It should be
> compiled as C.
>
>> Apparently strdup is also deprecated in recent versions of visual studio.
>>
> Again, this is catered for already as the headers turn off the requirement
> to use the secure versions, though you can certainly choose to do so.
>
>  @@ -152,9 +152,9 @@
>>     /// Returns the description string if there is one available (check
>> for NULL).
>>     ///
>>     void *            (*getDescription)    (struct
>> ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream);
>> +    void    (ANTLR3_CDECL    *free)                    (struct
>> ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream);
>>  -    void        (*free)                    (struct
>> ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream);
>>
> I doubt that this change is required - it certainly isn't with my version
> of Visual Studio 2008 (latest service packs) and wasn't with VS2005. There
> must be some other reason that you are getting these errors.
>
> Jim
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090201/341740b5/attachment.html 


More information about the antlr-interest mailing list