Jump to page: 1 2
Thread overview
HTOD: Low hanging fruit
Dec 06, 2013
Andre
Dec 06, 2013
Dicebot
Dec 06, 2013
Dicebot
Dec 06, 2013
Jacob Carlborg
Dec 06, 2013
Dicebot
Dec 06, 2013
Jacob Carlborg
Dec 06, 2013
Jacob Carlborg
Dec 06, 2013
Andrej Mitrovic
Dec 06, 2013
Jacob Carlborg
Dec 06, 2013
Jacob Carlborg
Dec 07, 2013
Andre
Dec 08, 2013
Jacob Carlborg
DStep with dub
Dec 09, 2013
John Colvin
Dec 09, 2013
Jacob Carlborg
Dec 09, 2013
John Colvin
Dec 09, 2013
Jacob Carlborg
Dec 11, 2013
Jacob Carlborg
December 06, 2013
Hi,

HTOD is not able to translate a #define if the
value is in brackets like here:

#define SQL_STILL_EXECUTING			2
#define SQL_ERROR				(-1)
#define SQL_INVALID_HANDLE			(-2)
#define SQL_NEED_DATA				99
(Example from ODBC header file sql.h)

This seems like a low hanging fruit.

Kind regards
André
December 06, 2013
On Friday, 6 December 2013 at 15:04:18 UTC, Andre wrote:
> Hi,
>
> HTOD is not able to translate a #define if the
> value is in brackets like here:
>
> #define SQL_STILL_EXECUTING			2
> #define SQL_ERROR				(-1)
> #define SQL_INVALID_HANDLE			(-2)
> #define SQL_NEED_DATA				99
> (Example from ODBC header file sql.h)
>
> This seems like a low hanging fruit.
>
> Kind regards
> André

htod is old and unsupported. I recommend dstep (https://github.com/jacob-carlborg/dstep) which is based on libclang and thus naturally up to date with current C state.
December 06, 2013
To be honest I'd love htod to be completely removed from
dlang.org (and possibly replaced with dstep) as it does more harm
than good.
December 06, 2013
On 2013-12-06 16:14, Dicebot wrote:

> htod is old and unsupported. I recommend dstep
> (https://github.com/jacob-carlborg/dstep) which is based on libclang and
> thus naturally up to date with current C state.

DStep doesn't currently support any preprocessor handling, except for some simple includes. The C interface for libclang need to be extended to support handling the preprocessor as well. Contributions are always welcome.

-- 
/Jacob Carlborg
December 06, 2013
On Friday, 6 December 2013 at 17:02:18 UTC, Jacob Carlborg wrote:
> On 2013-12-06 16:14, Dicebot wrote:
>
>> htod is old and unsupported. I recommend dstep
>> (https://github.com/jacob-carlborg/dstep) which is based on libclang and
>> thus naturally up to date with current C state.
>
> DStep doesn't currently support any preprocessor handling, except for some simple includes. The C interface for libclang need to be extended to support handling the preprocessor as well. Contributions are always welcome.

Does it simply ignores preprocessor tokens or actually makes substitutions (but there is no D-ification)? I thought it is the latter.
December 06, 2013
On 2013-12-06 18:10, Dicebot wrote:

> Does it simply ignores preprocessor tokens or actually makes
> substitutions (but there is no D-ification)? I thought it is the latter.

It does substitutions. I guess using libclang would be just like compiling with Clang but stop the process somewhere after the AST is created and before the code generating phase has started.

-- 
/Jacob Carlborg
December 06, 2013
On 2013-12-06 18:13, Jacob Carlborg wrote:

> It does substitutions. I guess using libclang would be just like
> compiling with Clang but stop the process somewhere after the AST is
> created and before the code generating phase has started.

This also has the unfortunate consequences that you can only generate bindings for one platform.

-- 
/Jacob Carlborg
December 06, 2013
On 12/6/13, Jacob Carlborg <doob@me.com> wrote:
> On 2013-12-06 18:13, Jacob Carlborg wrote:
>
>> It does substitutions. I guess using libclang would be just like compiling with Clang but stop the process somewhere after the AST is created and before the code generating phase has started.
>
> This also has the unfortunate consequences that you can only generate bindings for one platform.

I guess libtooling (http://clang.llvm.org/docs/LibTooling.html) would be a better fit for a codegenerator, but it's a C++ library.
December 06, 2013
On 12/6/13 7:15 AM, Dicebot wrote:
> To be honest I'd love htod to be completely removed from
> dlang.org (and possibly replaced with dstep) as it does more harm
> than good.

I agree. Please send a pull request.

Thanks,

Andrei
December 06, 2013
On 2013-12-06 19:35, Andrej Mitrovic wrote:

> I guess libtooling (http://clang.llvm.org/docs/LibTooling.html) would
> be a better fit for a codegenerator, but it's a C++ library.

I don't see what this would give me. libclang already handles command line parsing. DStep handles, in addition to those specified, all flags that Clang handles.

-- 
/Jacob Carlborg
« First   ‹ Prev
1 2