Question about version ( ) keyword

2016-03-21 Thread Vincent R via Digitalmars-d

Hi,

When looking at core definitions like core.sys.posix.pthread I 
can see some "duplicated" code because it seems version doesn't 
support Or as we would do in C/C++ with #ifdefined.

For instance if can read this:

version( CRuntime_Glibc )
{
enum PTHREAD_BARRIER_SERIAL_THREAD = -1;

int pthread_barrier_destroy(pthread_barrier_t*);
int pthread_barrier_init(pthread_barrier_t*, in 
pthread_barrierattr_t*, uint);

int pthread_barrier_wait(pthread_barrier_t*);
int pthread_barrierattr_destroy(pthread_barrierattr_t*);
int pthread_barrierattr_getpshared(in pthread_barrierattr_t*, 
int*);

int pthread_barrierattr_init(pthread_barrierattr_t*);
int pthread_barrierattr_setpshared(pthread_barrierattr_t*, 
int);

}
else version( FreeBSD )
{
enum PTHREAD_BARRIER_SERIAL_THREAD = -1;

int pthread_barrier_destroy(pthread_barrier_t*);
int pthread_barrier_init(pthread_barrier_t*, in 
pthread_barrierattr_t*, uint);

int pthread_barrier_wait(pthread_barrier_t*);
int pthread_barrierattr_destroy(pthread_barrierattr_t*);
int pthread_barrierattr_getpshared(in pthread_barrierattr_t*, 
int*);

int pthread_barrierattr_init(pthread_barrierattr_t*);
int pthread_barrierattr_setpshared(pthread_barrierattr_t*, 
int);

}
else version (OSX)
{
}
else version (Solaris)
{
enum PTHREAD_BARRIER_SERIAL_THREAD = -2;

int pthread_barrier_destroy(pthread_barrier_t*);
int pthread_barrier_init(pthread_barrier_t*, in 
pthread_barrierattr_t*, uint);

int pthread_barrier_wait(pthread_barrier_t*);
int pthread_barrierattr_destroy(pthread_barrierattr_t*);
int pthread_barrierattr_getpshared(in pthread_barrierattr_t*, 
int*);

int pthread_barrierattr_init(pthread_barrierattr_t*);
int pthread_barrierattr_setpshared(pthread_barrierattr_t*, 
int);

}
else version (CRuntime_Bionic)
{
}
else
{
static assert(false, "Unsupported platform");
}

When I see this code I cannot help thinking of something like:

version( CRuntime_Glibc ) || version( FreeBSD ) || version 
(Solaris)

{
if(version(Solaris))
   enum PTHREAD_BARRIER_SERIAL_THREAD = -2;
else
   enum PTHREAD_BARRIER_SERIAL_THREAD = -1;

int pthread_barrier_destroy(pthread_barrier_t*);
int pthread_barrier_init(pthread_barrier_t*, in 
pthread_barrierattr_t*, uint);

int pthread_barrier_wait(pthread_barrier_t*);
int pthread_barrierattr_destroy(pthread_barrierattr_t*);
int pthread_barrierattr_getpshared(in pthread_barrierattr_t*, 
int*);

int pthread_barrierattr_init(pthread_barrierattr_t*);
int pthread_barrierattr_setpshared(pthread_barrierattr_t*, 
int);

}
else version (OSX) ||version (CRuntime_Bionic)
{
}
else
{
static assert(false, "Unsupported platform");
}

I suppose language creators had good reasons to not allow it but 
I am a bit disapointed by the aspect of this language because 
some files are really verbose.
However I understand that this limitation allow a clear 
separation between different platforms...


Re: How can I report what I think a compiler's frontend bug

2016-03-21 Thread Vincent R via Digitalmars-d

On Monday, 21 March 2016 at 11:00:08 UTC, Vincent R wrote:

On Monday, 21 March 2016 at 09:46:18 UTC, Vincent R wrote:

On Monday, 21 March 2016 at 01:51:09 UTC, Marco Leise wrote:

Am Sun, 20 Mar 2016 22:37:37 +
schrieb Vincent R :

[...]


Thanks and you see I was right to post here since I finally 
found the problem and got an answer :-)


Unfortunately at the end I get a linker error:

1000@MLVD0032 MINGW64 ~/tmp/wxd/src/Samples
$ make
del *.cached
cd Controls
make
dmd -c -version=wx28 -version=__WXMSW__ -version=ANSI -I..\.. 
Controls.d
..\..\wx\common.d(153): Deprecation: function 
wx.common.new_Rectangle is deprecated
..\..\wx\common.d(153): Deprecation: function 
wx.common.new_Rectangle is deprecated


dmd -g -of..\..\bin\Controls.exe Controls.obj ..\..\wxd.lib 
..\..\wxc.lib 
C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxbase28d.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxbase28d_xml.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_core.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_adv.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_html.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_xrc.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxtiffd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxjpegd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxpngd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxzlibd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxregexd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxexpatd.lib   kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.l!

ib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib 
advapi32.lib wsock32.lib odbc32.lib-L/EXETYPE:NT -L/SU:WINDOWS:4.0

OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\DEV\msys64\home\1000\tmp\wxWidgets-2.8.12\lib\dmc_lib\wxexpatd.lib(xmlrole)
 Error 168: >64K Global Types


I tried with a gdc compiler compiled by myself and I was able to 
compile and launch my first sample application using 
wxWidgets-2.8.
Now I have some work to do to fix all the remaining warnings and 
errors but I hope that wxD will be very soon an alternative to 
existing gui framework for D.
In a perfect world I should also work on the D libraries to add 
support for mingwXX winpthreads because for the moment the gdc 
compiler is generated using --enable-threads=win32. As long as it 
cannot use posix thread it cannot be an official package of 
msys2/mingw64.




Re: How can I report what I think a compiler's frontend bug

2016-03-21 Thread Vincent R via Digitalmars-d

On Monday, 21 March 2016 at 09:46:18 UTC, Vincent R wrote:

On Monday, 21 March 2016 at 01:51:09 UTC, Marco Leise wrote:

Am Sun, 20 Mar 2016 22:37:37 +
schrieb Vincent R :

[...]


Thanks and you see I was right to post here since I finally 
found the problem and got an answer :-)


Unfortunately at the end I get a linker error:

1000@MLVD0032 MINGW64 ~/tmp/wxd/src/Samples
$ make
del *.cached
cd Controls
make
dmd -c -version=wx28 -version=__WXMSW__ -version=ANSI -I..\.. 
Controls.d
..\..\wx\common.d(153): Deprecation: function 
wx.common.new_Rectangle is deprecated
..\..\wx\common.d(153): Deprecation: function 
wx.common.new_Rectangle is deprecated


dmd -g -of..\..\bin\Controls.exe Controls.obj ..\..\wxd.lib 
..\..\wxc.lib 
C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxbase28d.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxbase28d_xml.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_core.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_adv.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_html.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_xrc.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxtiffd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxjpegd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxpngd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxzlibd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxregexd.lib  C:/DEV/msys64/home/1000/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxexpatd.lib   kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib!

 shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib 
advapi32.lib wsock32.lib odbc32.lib-L/EXETYPE:NT -L/SU:WINDOWS:4.0
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\DEV\msys64\home\1000\tmp\wxWidgets-2.8.12\lib\dmc_lib\wxexpatd.lib(xmlrole)
 Error 168: >64K Global Types


Re: How can I report what I think a compiler's frontend bug

2016-03-21 Thread Vincent R via Digitalmars-d

On Monday, 21 March 2016 at 01:51:09 UTC, Marco Leise wrote:

Am Sun, 20 Mar 2016 22:37:37 +
schrieb Vincent R :

[...]


Thanks and you see I was right to post here since I finally found 
the problem and got an answer :-)


Re: How can I report what I think a compiler's frontend bug

2016-03-20 Thread Vincent R via Digitalmars-d

On Sunday, 20 March 2016 at 19:06:32 UTC, Johan Engelen wrote:

On Sunday, 20 March 2016 at 17:57:12 UTC, Vincent R wrote:

On Sunday, 20 March 2016 at 16:16:18 UTC, Marco Leise wrote:

Am Sun, 20 Mar 2016 11:28:19 +
schrieb Vincent R :


Hi,

I would like to start a new project (a bonjour/zeroconf 
wrapper

and a gui browser using it).
For the gui part I would like to use my existing skills using
wxWidgets wrapper (wxD).
So I have started to report a problem a few months ago:
https://forum.dlang.org/post/rtarlodeojnmedgsn...@forum.dlang.org

But so far(DMD32 D Compiler v2.070.2) it's still not fixed.
Do you think it will be fixed one day ?

Thanks


Yes, I think it will be fixed one day, since - as you know
by reading the very thread you linked - it is already reported
and the GDC developers chimed in and considered it critical.
There are also 118 open critical/blocker bugs that were
reported before yours. Most of them by people here on the
forums and you would need to explain to us why your bug
deserves higher attention than the others (154 in total).

Dlang is free open-source software and there is only a hand 
full of people who are fixing bugs in the compiler just for 
the sake of improving it. Most people contribute occasionally 
when they are interested in a solution to a particular 
problem.


If you really need this fixed now ... you know the drill. I 
suggest you analyze the problem and start a discussion about 
it. Honestly asking why the compiler emits duplicate symbols 
in a reduced test case might have yielded you some good 
responses from the people who wrote the code.


Ok first maybe it's already reported to GDC but to me it's not 
only a gdc bug since it also happens with dmd. So I don't know 
how bugs are fixed in the differents compilers but I suppose 
they share the same frontend (maybe I am mistaken) and in this 
case I prefer not to wait for gdc developers to fix it but to 
see if for instance some dmd developers have some time to fix 
it.
I just want to use the language and don't have time to dig 
inside its inner workings, so I think D is not for me. This 
project was the opportunity to learn the language by fixing an 
unmaintained library (wxD) but it's not as easy as I thought.


What may speed-up bug fixing a lot is preparing a nice testcase 
that is *as small as possible*.
As you can see in the bug report [1], there is already a 
testcase. It is a good start, but it is not very minimal: 
contains a lot of comments etc. That is a lot of distraction / 
bother (for me at least). One way to help here is to minimize 
it further, and distill it down to the essential thing that 
appears to trigger the bug. You can do that without knowing any 
compiler internals.
It can be very time consuming to make such a testcase, which 
may discourage developers fixing of your bug.


[1] https://issues.dlang.org/show_bug.cgi?id=15324


Ok I think I have found the problem, here is the testcase:

alias TreeItemId wxTreeItemId;
public class TreeItemId : wxObject
{
public this(IntPtr wxobj)
{
super(wxobj);
}

private this(IntPtr wxobj, bool memOwn)
{
super(wxobj);
this.memOwn = memOwn;
}

public this()
{
this(wxTreeItemId_ctor(), true);
}

public this(void* pItem)
{
this(wxTreeItemId_ctor2(pItem), true);
}

override protected void dtor() { wxTreeItemId_dtor(wxobj); }
}

The problem is I think between public this(void* pItem) and 
public this(IntPtr wxobj)

because from what I understand they are the same.
If I comment one of the two constructors it seems to remove the 
warning about duplicated symbols. Now I need to understand what 
the original author wanted to do by declaring these 2 
constructors.




Re: How can I report what I think a compiler's frontend bug

2016-03-20 Thread Vincent R via Digitalmars-d

On Sunday, 20 March 2016 at 16:16:18 UTC, Marco Leise wrote:

Am Sun, 20 Mar 2016 11:28:19 +
schrieb Vincent R :


Hi,

I would like to start a new project (a bonjour/zeroconf wrapper
and a gui browser using it).
For the gui part I would like to use my existing skills using
wxWidgets wrapper (wxD).
So I have started to report a problem a few months ago:
https://forum.dlang.org/post/rtarlodeojnmedgsn...@forum.dlang.org

But so far(DMD32 D Compiler v2.070.2) it's still not fixed.
Do you think it will be fixed one day ?

Thanks


Yes, I think it will be fixed one day, since - as you know
by reading the very thread you linked - it is already reported
and the GDC developers chimed in and considered it critical.
There are also 118 open critical/blocker bugs that were
reported before yours. Most of them by people here on the
forums and you would need to explain to us why your bug
deserves higher attention than the others (154 in total).

Dlang is free open-source software and there is only a hand 
full of people who are fixing bugs in the compiler just for the 
sake of improving it. Most people contribute occasionally when 
they are interested in a solution to a particular problem.


If you really need this fixed now ... you know the drill. I 
suggest you analyze the problem and start a discussion about 
it. Honestly asking why the compiler emits duplicate symbols in 
a reduced test case might have yielded you some good responses 
from the people who wrote the code.


Ok first maybe it's already reported to GDC but to me it's not 
only a gdc bug since it also happens with dmd. So I don't know 
how bugs are fixed in the differents compilers but I suppose they 
share the same frontend (maybe I am mistaken) and in this case I 
prefer not to wait for gdc developers to fix it but to see if for 
instance some dmd developers have some time to fix it.
I just want to use the language and don't have time to dig inside 
its inner workings, so I think D is not for me. This project was 
the opportunity to learn the language by fixing an unmaintained 
library (wxD) but it's not as easy as I thought.



Cheers






How can I report what I think a compiler's frontend bug

2016-03-20 Thread Vincent R via Digitalmars-d

Hi,

I would like to start a new project (a bonjour/zeroconf wrapper 
and a gui browser using it).
For the gui part I would like to use my existing skills using 
wxWidgets wrapper (wxD).

So I have started to report a problem a few months ago:
https://forum.dlang.org/post/rtarlodeojnmedgsn...@forum.dlang.org

But so far(DMD32 D Compiler v2.070.2) it's still not fixed.
Do you think it will be fixed one day ?

Thanks


Re: Linker error with dmd when trying to generate wxWidgets wrapper on Windows (msys2/mingw-w64)

2015-12-09 Thread Vincent R via Digitalmars-d

On Tuesday, 1 December 2015 at 16:46:21 UTC, Vincent R wrote:

On Tuesday, 1 December 2015 at 10:21:11 UTC, Luis wrote:

On Monday, 30 November 2015 at 09:23:33 UTC, Vincent R wrote:

On Friday, 27 November 2015 at 09:56:10 UTC, Kagamin wrote:
The bug report is 
https://issues.dlang.org/show_bug.cgi?id=15324


Just hope it will be fixed soon because I gave up D 7 years 
ago (too many bugs, war between phobos, tango, very young 
language) and now I realize it still very complicated to use 
it (at least on windows).


Yeah, on Linux simply just works. On Windows, there is more 
issues...


Not even sure it works on linux because on the bug report 
above, platform is linux...


Do we know when it will be fixed because I would like to keep on 
progressing on my project and if it takes too much time I will 
use another language (go language is my next candidate) ?




Re: Linker error with dmd when trying to generate wxWidgets wrapper on Windows (msys2/mingw-w64)

2015-12-01 Thread Vincent R via Digitalmars-d

On Tuesday, 1 December 2015 at 10:21:11 UTC, Luis wrote:

On Monday, 30 November 2015 at 09:23:33 UTC, Vincent R wrote:

On Friday, 27 November 2015 at 09:56:10 UTC, Kagamin wrote:
The bug report is 
https://issues.dlang.org/show_bug.cgi?id=15324


Just hope it will be fixed soon because I gave up D 7 years 
ago (too many bugs, war between phobos, tango, very young 
language) and now I realize it still very complicated to use 
it (at least on windows).


Yeah, on Linux simply just works. On Windows, there is more 
issues...


Not even sure it works on linux because on the bug report above, 
platform is linux...


Re: Linker error with dmd when trying to generate wxWidgets wrapper on Windows (msys2/mingw-w64)

2015-11-30 Thread Vincent R via Digitalmars-d

On Friday, 27 November 2015 at 09:56:10 UTC, Kagamin wrote:

The bug report is https://issues.dlang.org/show_bug.cgi?id=15324


Just hope it will be fixed soon because I gave up D 7 years ago 
(too many bugs, war between phobos, tango, very young language) 
and now I realize it still very complicated to use it (at least 
on windows).


Linker error with dmd when trying to generate wxWidgets wrapper on Windows (msys2/mingw-w64)

2015-11-26 Thread Vincent R via Digitalmars-d

Hi,

I have a problem to generate D wrapper for wxWidgets (wxD) on 
msys2/mingw64.

Here is how to reproduce it:

1) Install msys2 from here http://msys2.github.io/

2) Launch msys2 terminal and add dmc/dmd to PATH

$ mkdir tmp && cd tmp
$ export 
PATH="C:\Developer\D\dm\bin":"C:\Developer\D\dmd2\windows\bin":$PATH
$ wget 
https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxWidgets-2.8.12.tar.gz

$ cd wxWidgets-2.8.12/build/msw
$ make -f makefile.dmc
$ export WXDIR=/home/Vincent/tmp/wxWidgets-2.8.12
$ cd ~/tmp
$ git clone https://github.com/vrichomme/wxd.git
$ cd wxd/src
$ make
...
Warning: Public 
'_D2wx8TreeCtrl10TreeItemId6__ctorMFPvZC2wx8TreeCtrl10TreeItemId' 
already in library, redefinition ignored.


Then when I try to generate some samples I have an error about 
the same symbol:


$ cd Samples/

dmd -c -version=wx28 -version=__WXMSW__ -version=ANSI -I..\.. 
Font.d
Font.d(15): Deprecation: module std.stream is deprecated - It 
will be removed from Phobos in October 2016. If you still need 
it, go to https://github.com/DigitalMars/undeaD
..\..\wx\common.d(151): Deprecation: function 
wx.common.new_Rectangle is deprecated
..\..\wx\common.d(151): Deprecation: function 
wx.common.new_Rectangle is deprecated
Font.d(667): Deprecation: implicitly overriding base class method 
wx.FontMisc.FontEnumerator.Facenames with 
Font.MyFontEnumerator.Facenames deprecated; add 'override' 
attribute


dmd -g -of..\..\bin\Font.exe Font.obj ..\..\wxd.lib ..\..\wxc.lib 
C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxbase28d.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxbase28d_xml.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_core.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_adv.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_html.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_xrc.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxtiffd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxjpegd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxpngd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxzlibd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxregexd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxexpatd.lib   kernel32.!

lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib 
comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib 
wsock32.lib odbc32.lib-L/EXETYPE:NT -L/SU:WINDOWS:4.0
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
..\..\wxd.lib(TreeCtrl)  Offset B471FH Record Type 00C3
 Error 1: Previous Definition Different : 
_D2wx8TreeCtrl10TreeItemId6__ctorMFPvZC2wx8TreeCtrl10TreeItemId

C:\Developer\msys64\home\Vincent\tmp\wxWidgets-2.8.12\lib\dmc_lib\wxbase28d.lib(dircmn)
 Error 168: >64K Global Types


So I don't know if the bug is inside the wrapper or the 
compiler/linker.

I should add that I have the same issue with gdc.

Need someone to look at it.

Thanks







Re: How to fix "Error symbol '.....' is already defined"

2015-11-12 Thread Vincent R via Digitalmars-d-learn

On Thursday, 12 November 2015 at 08:45:57 UTC, Kagamin wrote:

Looks like a bug in the compiler.


In this case it means there is a bug inside dmd and gdc (didn't 
try ldc)...


How to fix "Error symbol '.....' is already defined"

2015-11-11 Thread Vincent R via Digitalmars-d-learn

Hi,

I have a small project and I would like to use D to build it.
I am working on Windows and I have already generated a gdc 
compiler through msys2/mingw64 and now I would like to compile 
the old.unmaintained wxWidgets wrapper called wxd.
I have forked the project here: https://github.com/vrichomme/wxd 
and tried to fix the easiest errors but now there is still an 
error about symbol already defined:


http://dpaste.dzfl.pl/c925e7f888e8

By looking at 
https://github.com/vrichomme/wxd/blob/master/src/wx/TreeCtrl.d do 
you know why I get this error ?
When using dmd I still have the warning but the linker ignores 
it, however since my project is for a raspberrypi I prefer to use 
the same toolchain on destop(gdc).


Thanks



Re: Generate wxD with dmc/dmd

2015-11-09 Thread Vincent R via Digitalmars-d

On Saturday, 7 November 2015 at 22:12:55 UTC, Vincent R wrote:

Hi,

I am trying to generate the wxWidgets wrapper wxD on Windows 
through msys/mingw64(or cygwin).
So I have downloaded wxWidgets-2.8.12 and dmd c++/d compiler 
respectively dmc/dmd but I still have an error.

Let's consider we are using cygwin:

[...]


Actually I found my problem you can ignore my previous message.


Generate wxD with dmc/dmd

2015-11-07 Thread Vincent R via Digitalmars-d

Hi,

I am trying to generate the wxWidgets wrapper wxD on Windows 
through msys/mingw64(or cygwin).
So I have downloaded wxWidgets-2.8.12 and dmd c++/d compiler 
respectively dmc/dmd but I still have an error.

Let's consider we are using cygwin:

$ export 
PATH="C:\Developer\D\dm\bin":"C:\Developer\D\dmd2\windows\bin":$PATH

$ cd ~
$ unzip wxWidgets-2.8.12.zip
$ cd wxWidgets-2.8.12/include/wx
$ cp setup_inc.h setup.h
$ export 
WXDIR="C:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12"


$ cd ~
$ git clone https://github.com/afb/wxd.git
$ cd wxD
$ make

cd wxc
make
dmc -D__DMD__ -mn -g -o+none -D -D__WXDEBUG__  
-IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include  -IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\lib\dmc_lib\mswd -w- -I. -WA -DNOPCH -HP90 -Ar -Ae   -HP99 -c -owx-release.obj wx-release.cpp
Error 
C:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include\wx/chkconf.h 1817:  "wxClipboard requires wxDataObject"

--- errorlevel 1

the file to be compiled wx-release.cpp has the following lines:

#include 
#include "wx/defs.h"

#if defined(__APPLE__) && !(wxCHECK_VERSION(2,6,1)) // will be 
2.6.4 eventually

/* don't support the broken 2.5.3, in Mac OS X 10.4 */
#error "unsupported wxWidgets version, please upgrade"
#endif

int main(int argc, char *argv[])
{
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'v')
printf("WX_RELEASE_NODOT = ");
printf("%d%d\n", wxMAJOR_VERSION, wxMINOR_VERSION);
return 0;
}


When I look at chkconf.h 1817:

#if wxUSE_CLIPBOARD && !wxUSE_DATAOBJ
#   ifdef wxABORT_ON_CONFIG_ERROR
#   error "wxClipboard requires wxDataObject"
#   else
#   undef wxUSE_DATAOBJ
#   define wxUSE_DATAOBJ 1
#   endif
#endif /* wxUSE_CLIPBOARD */

BUT inside the setup.h I am sure that wxUSE_CLIPBOARD and 
wxUSE_DATAOBJ are true...


When we look at source code we can see that wx/defs.h is included 
and it's this file that includes wx/setup.h but the compiler 
doesn't seem to see it...


But I have also found something weird, if I put some garbage text 
just before include  the compiler is not happy:


$ make
cd wxc
make
dmc -D__DMD__ -mn -g -o+none -D -D__WXDEBUG__  
-IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include  -IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\lib\dmc_lib\mswd -w- -I. -WA -DNOPCH -HP90 -Ar -Ae   -HP99 -c -owx-release.obj wx-release.cpp

extern "C" {
 ^
C:\Developer\D\dm\bin\..\include\stdio.h(10) : Error: missing 
decl-specifier-seq for declaration of 'ss'

size_t  __CLIB fread(void *,size_t,size_t,FILE *);


but if I put the same letters just after , compiler 
doesn't give an error about unrecognized tokens !!!


#include 
ss

$ make
cd wxc
make
dmc -D__DMD__ -mn -g -o+none -D -D__WXDEBUG__  
-IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include  -IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\lib\dmc_lib\mswd -w- -I. -WA -DNOPCH -HP90 -Ar -Ae   -HP99 -c -owx-release.obj wx-release.cpp
Error 
C:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include\wx/chkconf.h 1817:  "wxClipboard requires wxDataObject"

--- errorlevel 1





Re: D bindings for Bonjour

2015-10-28 Thread Vincent R via Digitalmars-d-learn

On Wednesday, 28 October 2015 at 16:09:02 UTC, Cauterite wrote:

On Wednesday, 28 October 2015 at 16:04:52 UTC, Vincent R wrote:

[...]


enum kDNSServiceOutputFlags = (kDNSServiceFlagsValidate | 
kDNSServiceFlagsValidateOptional | kDNSServiceFlagsMoreComing | 
kDNSServiceFlagsAdd | kDNSServiceFlagsDefault);


Good luck :)


I wanted to delete my post when I realize the stupidity of my 
question. Actually I ask my question before really looking at it.

Sorry


D bindings for Bonjour

2015-10-28 Thread Vincent R via Digitalmars-d-learn

Hi,

I am starting my first project in D and I would like to do a 
Bonjour(Zeroconf) browser app.
My first task is to write a binding to the dns_sd library but I 
have an issue with the following macro:


#define kDNSServiceOutputFlags (kDNSServiceFlagsValidate | 
kDNSServiceFlagsValidateOptional | kDNSServiceFlagsMoreComing | 
kDNSServiceFlagsAdd | kDNSServiceFlagsDefault)


It justs takes some enum (defined above but not shown here) and 
do a OR operation on it.


How can I express that in D ?

Do I need to use a template  as shown here 
http://wiki.dlang.org/D_binding_for_C or a varg function ?


Thanks


Re: D bindings for Bonjour

2015-10-28 Thread Vincent R via Digitalmars-d-learn

On Wednesday, 28 October 2015 at 16:12:08 UTC, Vincent R wrote:

On Wednesday, 28 October 2015 at 16:09:02 UTC, Cauterite wrote:

On Wednesday, 28 October 2015 at 16:04:52 UTC, Vincent R wrote:

[...]


enum kDNSServiceOutputFlags = (kDNSServiceFlagsValidate | 
kDNSServiceFlagsValidateOptional | kDNSServiceFlagsMoreComing 
| kDNSServiceFlagsAdd | kDNSServiceFlagsDefault);


Good luck :)


I wanted to delete my post when I realize the stupidity of my 
question. Actually I ask my question before really looking at 
it.

Sorry


Is there any central place where you store bindings ?


Re: D bindings for Bonjour

2015-10-28 Thread Vincent R via Digitalmars-d-learn

On Wednesday, 28 October 2015 at 16:53:15 UTC, Daniel Kozák wrote:

V Wed, 28 Oct 2015 16:36:32 +
Vincent R via Digitalmars-d-learn 
<digitalmars-d-learn@puremagic.com>

napsáno:


On Wednesday, 28 October 2015 at 16:12:08 UTC, Vincent R wrote:
> On Wednesday, 28 October 2015 at 16:09:02 UTC, Cauterite 
> wrote:
>> On Wednesday, 28 October 2015 at 16:04:52 UTC, Vincent R 
>> wrote:

>>> [...]
>>
>> enum kDNSServiceOutputFlags = (kDNSServiceFlagsValidate | 
>> kDNSServiceFlagsValidateOptional | 
>> kDNSServiceFlagsMoreComing | kDNSServiceFlagsAdd | 
>> kDNSServiceFlagsDefault);

>>
>> Good luck :)
>
> I wanted to delete my post when I realize the stupidity of my
> question. Actually I ask my question before really looking at
> it.
> Sorry

Is there any central place where you store bindings ?


code.dlang.org -- general place for every d project


Ok thanks.
Sorry to ask so much question but how do you declare different 
calling conventions like the following macro:



#if defined(_WIN32)
#define DNSSD_API __stdcall
#else
#define DNSSD_API
#endif


From what I understand I could write:

version (Windows)
{
extern (Windows)
{
int DNSServiceGetProperty
(
 in char *property,
 void   *result,
 uint   *size
 );
}
}
else
{
extern (C)
{
int DNSServiceGetProperty
(
 in char *property,
 void   *result,
 uint   *size
 );
}
}

but I don't want to write it once.
How can I solve this ?
And if there is an easy fix what about writing it inside the wiki 
page:

http://wiki.dlang.org/D_binding_for_C

Thanks