Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.

2016-12-16 Thread Mike Parker via Digitalmars-d-learn
On Friday, 16 December 2016 at 22:37:13 UTC, hardreset wrote: To be honest I was having some odd linking problems anyway. I initially wrapped the FT init function in plain D function and that kept causing "_FT_ not found" link errors. As soon as I took all the actual D functions out and

Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.

2016-12-16 Thread hardreset via Digitalmars-d-learn
On Friday, 16 December 2016 at 00:40:07 UTC, Mike Parker wrote: On Thursday, 15 December 2016 at 20:34:47 UTC, hardreset wrote: On Thursday, 15 December 2016 at 18:30:14 UTC, hardreset wrote: I have pragma(lib,**fullpath**) in my freetype.d file, is that the correct way? Never mind,

Re: Allocating a class within another class during object init w/o passing in an allocator

2016-12-16 Thread ag0aep6g via Digitalmars-d-learn
On Friday, 16 December 2016 at 18:25:42 UTC, David Zhang wrote: I though all classes were aligned to sizeof(size_t) boundaries? I don't know. Wouldn't it then just be align(sizeof(size_t)) byte[__traits(classInstanceSize, SomeClass)] scStorage; I guess? I really don't have much of a

Re: BetterC classes

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 16 December 2016 at 16:24:18 UTC, Daniel N wrote: On Friday, 16 December 2016 at 15:17:15 UTC, Ilya Yaroshenko wrote: Hi Is it possible to use classes, which do not have monitor and other DRuntime stuff? Object can be allocated/deallocated using allocators, but they are very

Re: Allocating a class within another class during object init w/o passing in an allocator

2016-12-16 Thread David Zhang via Digitalmars-d-learn
I haven't considered alignment here. I'm not sure if you have to. I though all classes were aligned to sizeof(size_t) boundaries? Wouldn't it then just be align(sizeof(size_t)) byte[__traits(classInstanceSize, SomeClass)] scStorage;

Re: BetterC classes

2016-12-16 Thread Daniel N via Digitalmars-d-learn
On Friday, 16 December 2016 at 15:17:15 UTC, Ilya Yaroshenko wrote: Hi Is it possible to use classes, which do not have monitor and other DRuntime stuff? Object can be allocated/deallocated using allocators, but they are very complex for betterC mode (monitor, mutex, object.d dependency).

Re: extern(C++) struct - what is it?

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 16 December 2016 at 13:02:11 UTC, Nicholas Wilson wrote: On Friday, 16 December 2016 at 12:40:19 UTC, Ilya Yaroshenko wrote: [...] Like any other struct. [...] Thank you Nicholas

BetterC classes

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
Hi Is it possible to use classes, which do not have monitor and other DRuntime stuff? Object can be allocated/deallocated using allocators, but they are very complex for betterC mode (monitor, mutex, object.d dependency). Can we have something more primitive? Ilya

Re: extern(C++) struct - what is it?

2016-12-16 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 16 December 2016 at 12:40:19 UTC, Ilya Yaroshenko wrote: It was in DMD sources. How it can be used? Are methods virtual? How multiple inheritance works? Can this be used in betterC mode? What different between classes in C++? Thanks, Ilya See also

Re: extern(C++) struct - what is it?

2016-12-16 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 16 December 2016 at 12:40:19 UTC, Ilya Yaroshenko wrote: It was in DMD sources. How it can be used? Like any other struct. Are methods virtual? No. How multiple inheritance works? Don't think it works. Can this be used in betterC mode? Yes all it should affect is the

Re: not callable error

2016-12-16 Thread Anders S via Digitalmars-d-learn
On Friday, 4 November 2016 at 23:26:40 UTC, lobo wrote: On Friday, 4 November 2016 at 14:37:04 UTC, bluphantom91 wrote: On Friday, 4 November 2016 at 02:59:49 UTC, Paul Backus wrote: On Friday, 4 November 2016 at 02:28:17 UTC, bluphantom91 wrote: Hello, Am I just using getc the wrong

extern(C++) struct - what is it?

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
It was in DMD sources. How it can be used? Are methods virtual? How multiple inheritance works? Can this be used in betterC mode? What different between classes in C++? Thanks, Ilya

Re: Other libraries - web site link, and other thoughts

2016-12-16 Thread Chris via Digitalmars-d-learn
Forgive if I'm suggesting something which was already discussed and dismissed, but I too would love a way to leverage C++ stuff into D. Can't we go to C++? Meaning there's a C++ compiler coming from the same hands as D. Couldn't we try to get the C++ compiler to compile in such a manner that D

Re: reading from file

2016-12-16 Thread Ali Çehreli via Digitalmars-d-learn
On 12/15/2016 10:47 PM, KaattuPoochi wrote: > On Tuesday, 13 December 2016 at 21:13:26 UTC, Ali wrote: >> >> And extending Ali's solution you can actually get the data in >> to a two dimentional array at compile time and have it in static >> memory with a small adjustment: >> >> static immutable

Re: reading from file

2016-12-16 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 16 December 2016 at 06:47:15 UTC, KaattuPoochi wrote: On Tuesday, 13 December 2016 at 21:13:26 UTC, Ali wrote: And extending Ali's solution you can actually get the data in to a two dimentional array at compile time and have it in static memory with a small adjustment: static