digitalmars.D.learn - C to D convertor
- =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= (47/47) Aug 21 2021 I know, i know... It not possible, but part of the C code we can
- evilrat (7/13) Aug 21 2021 dstep
- =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= (2/17) Aug 21 2021 evilrat, thank you!
- Dennis (3/4) Aug 24 2021 CPP2D
- =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= (2/7) Aug 24 2021 Dennis, thank!
I know, i know... It not possible, but part of the C code we can
to convert to the D.
Show me, please, solutions, projects, tools, scripts, docs.
Can you give the link ?
Examples of what the wanted:
// C
typedef struct {
uint32_t version; /* 0x5000 */
uint16_t num_glyphs;
} MaxProTable;
// D
struct MaxProTable {
uint32_t version; /* 0x5000 */
uint16_t num_glyphs;
}
// C
#define ENABLE_SUBDIV 0
// D
enum ENABLE_SUBDIV = 0;
// C
#include "triangulate.h"
// D
import triangulate;
// C
#include <string.h>
// D
import core.stdc.string;
// C
#define cross2(a,b) ((a)[0]*(b)[1]-(a)[1]*(b)[0])
// D
pragma( inline, true )
auto cross2( T1, T2 )( T1 a, T2 b ) { return
((a)[0]*(b)[1]-(a)[1]*(b)[0]); }
// C
double ab[2];
// D
double[2] ab;
// C
trgu = calloc( 1, sizeof(*trgu) );
// D
trgu = calloc( 1, (*trgu).sizeof );
// C
PointFlag *point_flags = gt->flags;
// D
PointFlag *point_flags = gt.flags;
`htod` is 1.
Any more ?
Aug 21 2021
On Saturday, 21 August 2021 at 08:14:22 UTC, Виталий Фадеев wrote:I know, i know... It not possible, but part of the C code we can to convert to the D. Show me, please, solutions, projects, tools, scripts, docs. Can you give the link ? `htod` is 1. Any more ?dstep https://code.dlang.org/packages/dstep dpp https://code.dlang.org/packages/dpp ohmygentool https://github.com/Superbelko/ohmygentool
Aug 21 2021
On Saturday, 21 August 2021 at 08:59:55 UTC, evilrat wrote:On Saturday, 21 August 2021 at 08:14:22 UTC, Виталий Фадеев wrote:evilrat, thank you!I know, i know... It not possible, but part of the C code we can to convert to the D. Show me, please, solutions, projects, tools, scripts, docs. Can you give the link ? `htod` is 1. Any more ?dstep https://code.dlang.org/packages/dstep dpp https://code.dlang.org/packages/dpp ohmygentool https://github.com/Superbelko/ohmygentool
Aug 21 2021
On Saturday, 21 August 2021 at 08:14:22 UTC, Виталий Фадеев wrote:Any more ?CPP2D https://github.com/lhamot/CPP2D
Aug 24 2021
On Tuesday, 24 August 2021 at 11:52:45 UTC, Dennis wrote:On Saturday, 21 August 2021 at 08:14:22 UTC, Виталий Фадеев wrote:Dennis, thank!Any more ?CPP2D https://github.com/lhamot/CPP2D
Aug 24 2021









=?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= 