Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread Jacob Carlborg
On 2011-02-26 17:06, Mike Wey wrote: On 02/26/2011 11:49 AM, Jacob Carlborg wrote: On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple of sources on this: 1) http://www.digitalmars.com/d/2.0/htomodule.html 2)

Re: Problem with std.regex: *+? not allowed in atom

2011-02-27 Thread Jacob Carlborg
On 2011-02-26 19:49, Dmitry Olshansky wrote: On 26.02.2011 19:52, Jacob Carlborg wrote: On 2011-02-26 12:29, Dmitry Olshansky wrote: On 26.02.2011 14:10, Jacob Carlborg wrote: I'm trying to use the std.regex module but when I run my application I get an exception. The exception message says:

Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread Jacob Carlborg
On 2011-02-26 17:58, simendsjo wrote: On 26.02.2011 17:06, Mike Wey wrote: On 02/26/2011 11:49 AM, Jacob Carlborg wrote: On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple of sources on this: 1)

Re: Initializing a class pointer

2011-02-27 Thread Steven Schveighoffer
On Sat, 26 Feb 2011 19:46:18 -0500, Tyro[a.c.edwards] nos...@home.com wrote: On 2/27/2011 8:52 AM, Simen kjaeraas wrote: Tyro[a.c.edwards] nos...@home.com wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller * pCtrl = WinGetLongController * (hwnd); . . .

Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread Steven Schveighoffer
On Sat, 26 Feb 2011 22:24:52 -0500, Bekenn leav...@alone.com wrote: On 2/25/2011 7:24 PM, Steven Schveighoffer wrote: BTW, I think long long is a gnu extension, it's not standard C (I don't think long long exists in Visual C for instance). I'm pretty sure it's standard as of C99 (though not

Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread simendsjo
On 27.02.2011 11:43, Jacob Carlborg wrote: On 2011-02-26 17:58, simendsjo wrote: On 26.02.2011 17:06, Mike Wey wrote: On 02/26/2011 11:49 AM, Jacob Carlborg wrote: On 2011-02-26 01:28, simendsjo wrote: C is not my strong side, so I'm having some problems wrapping some code. I found a couple

Re: Interfacing with c and platform dependent sizes

2011-02-27 Thread Jonathan M Davis
On Sunday 27 February 2011 05:41:49 Steven Schveighoffer wrote: On Sat, 26 Feb 2011 22:24:52 -0500, Bekenn leav...@alone.com wrote: On 2/25/2011 7:24 PM, Steven Schveighoffer wrote: BTW, I think long long is a gnu extension, it's not standard C (I don't think long long exists in Visual C

Version very simple?

2011-02-27 Thread simendsjo
I'm having some problems grokking version. How would I translate this simple C macro? #if !defined(IDENT) || !defined(IDENT2) I've tried the following: version(!IDENT) identifier or integer expected, not ! !version(IDENT) Declaration expected, not '!' version(IDENT || IDENT2) found '||'

Re: Version very simple?

2011-02-27 Thread Steven Schveighoffer
On Sun, 27 Feb 2011 09:52:01 -0500, simendsjo simen.end...@pandavre.com wrote: I'm having some problems grokking version. How would I translate this simple C macro? #if !defined(IDENT) || !defined(IDENT2) I've tried the following: version(!IDENT) identifier or integer expected, not !

Re: Version very simple?

2011-02-27 Thread David Nadlinger
On 2/27/11 3:52 PM, simendsjo wrote: I'm having some problems grokking version. How would I translate this simple C macro? #if !defined(IDENT) || !defined(IDENT2) You are facing a quite common question, with the answer being that there is no simpler way to do this, at least that I know of.

Re: Version very simple?

2011-02-27 Thread David Nadlinger
On 2/27/11 4:14 PM, Steven Schveighoffer wrote: But here is essentially the way to do your thingy. version(IDENT) { } else version(IDENT2) { } else { version=NOT_IDENT_OR_IDENT2; } version(NOT_IDENT_OR_IDENT2) { ... } Wouldn't that be »!(IDENT || IDENT2)«, as opposed to »!IDENT || !IDENT2«?

Re: Version very simple?

2011-02-27 Thread simendsjo
On 27.02.2011 16:18, David Nadlinger wrote: On 2/27/11 3:52 PM, simendsjo wrote: I'm having some problems grokking version. How would I translate this simple C macro? #if !defined(IDENT) || !defined(IDENT2) You are facing a quite common question, with the answer being that there is no

Re: Version very simple?

2011-02-27 Thread Lars T. Kyllingstad
On Sun, 27 Feb 2011 15:52:01 +0100, simendsjo wrote: I'm having some problems grokking version. How would I translate this simple C macro? #if !defined(IDENT) || !defined(IDENT2) I've tried the following: version(!IDENT) identifier or integer expected, not ! !version(IDENT)

Re: Version very simple?

2011-02-27 Thread simendsjo
On 27.02.2011 17:27, Lars T. Kyllingstad wrote: On Sun, 27 Feb 2011 15:52:01 +0100, simendsjo wrote: I'm having some problems grokking version. How would I translate this simple C macro? #if !defined(IDENT) || !defined(IDENT2) I've tried the following: version(!IDENT) identifier or

Re: Version very simple?

2011-02-27 Thread Steven Schveighoffer
On Sun, 27 Feb 2011 10:20:46 -0500, David Nadlinger s...@klickverbot.at wrote: On 2/27/11 4:14 PM, Steven Schveighoffer wrote: But here is essentially the way to do your thingy. version(IDENT) { } else version(IDENT2) { } else { version=NOT_IDENT_OR_IDENT2; } version(NOT_IDENT_OR_IDENT2) {

Named Pipes IPC in D for windows and linux ?

2011-02-27 Thread Tarun Ramakrishna
Hi, Is there anything in the standard library to do named pipes IPC in both windows and linux ? I am not necessarily looking for a unified API, anything that will allow me to setup named pipes on either OS and read/write on them will do. Thanks, Tarun

Defining type coercion

2011-02-27 Thread Peter Lundgren
I'd like to define a type Ordinal which behaves like an int (using a struct or alias) that represents the 26 letters, A-Z, with the numbers 1-26. Then, I would like to be able to coerce between chars and Ordinals appropriately. chars and ints already have the ability to coerce between each other

Re: Named Pipes IPC in D for windows and linux ?

2011-02-27 Thread Johannes Pfau
Tarun Ramakrishna wrote: Hi, Is there anything in the standard library to do named pipes IPC in both windows and linux ? I am not necessarily looking for a unified API, anything that will allow me to setup named pipes on either OS and read/write on them will do. Thanks, Tarun I'm not sure but I

Re: Named Pipes IPC in D for windows and linux ?

2011-02-27 Thread Tarun Ramakrishna
Hi Johannes, Thanks! I located mkfifo in 'core.sys.posix.sys.stat'. I couldn't find anything for named pipes in the standard library, but there is a Windows API project in dsource and the module 'win32.winbase' has declarations for 'CreateNamedPipe', etc. I guess this will do. Best Regards,

Re: Version very simple?

2011-02-27 Thread Jonathan M Davis
On Sunday 27 February 2011 07:18:29 David Nadlinger wrote: On 2/27/11 3:52 PM, simendsjo wrote: I'm having some problems grokking version. How would I translate this simple C macro? #if !defined(IDENT) || !defined(IDENT2) You are facing a quite common question, with the answer being

Re: Defining type coercion

2011-02-27 Thread Bekenn
On 2/27/2011 12:10 PM, Peter Lundgren wrote: I'd like to define a type Ordinal which behaves like an int (using a struct or alias) that represents the 26 letters, A-Z, with the numbers 1-26. Then, I would like to be able to coerce between chars and Ordinals appropriately. chars and ints already

Re: Icons

2011-02-27 Thread Joel Christensen
Thanks, Chapman :-), I followed your instructions and they worked.

Re: Defining type coercion

2011-02-27 Thread Jonathan M Davis
On Sunday 27 February 2011 12:10:43 Peter Lundgren wrote: I'd like to define a type Ordinal which behaves like an int (using a struct or alias) that represents the 26 letters, A-Z, with the numbers 1-26. Then, I would like to be able to coerce between chars and Ordinals appropriately. chars

Re: Icons

2011-02-27 Thread Joel Christensen
I got it working with the DAllegro (Allegro 4.2) game library as well!

Re: Defining type coercion

2011-02-27 Thread Simen kjaeraas
Peter Lundgren lundg...@rose-hulman.edu wrote: I'd like to define a type Ordinal which behaves like an int (using a struct or alias) that represents the 26 letters, A-Z, with the numbers 1-26. Then, I would like to be able to coerce between chars and Ordinals appropriately. chars and ints

Re: Defining type coercion

2011-02-27 Thread Jonathan M Davis
On Sunday 27 February 2011 21:57:26 Simen kjaeraas wrote: Peter Lundgren lundg...@rose-hulman.edu wrote: I'd like to define a type Ordinal which behaves like an int (using a struct or alias) that represents the 26 letters, A-Z, with the numbers 1-26. Then, I would like to be able to

Ini parsing library in D ?

2011-02-27 Thread Tarun Ramakrishna
Hi, Do we have a ini parser in D somewhere ? If not, is there some documentation anywhere that tells one how to wrap a simple C++ library like simple ini ? (Of course it isn't difficult to build a quick parser, just that someone would done this already) Thanks, Tarun

Re: Ini parsing library in D ?

2011-02-27 Thread Bekenn
On 2/27/2011 11:04 PM, Tarun Ramakrishna wrote: Hi, Do we have a ini parser in D somewhere ? If not, is there some documentation anywhere that tells one how to wrap a simple C++ library like simple ini ? (Of course it isn't difficult to build a quick parser, just that someone would done this

Re: Ini parsing library in D ?

2011-02-27 Thread Tarun Ramakrishna
Thanks Bekenn! On Mon, Feb 28, 2011 at 12:53 PM, Bekenn leav...@alone.com wrote: On 2/27/2011 11:04 PM, Tarun Ramakrishna wrote: Hi, Do we have a ini parser in D somewhere ? If not, is there some documentation anywhere that tells one how to wrap a simple C++ library like simple ini ? (Of