What is the best way to translate following to D?
#define MAKELONG(a, b) \
((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16))
The point is I would like to be able to use that at compile-time. The
macro is supposed to define some constants.
Am 06.07.2011, 16:15 Uhr, schrieb teo :
What is the best way to translate following to D?
#define MAKELONG(a, b) \
((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16))
The point is I would like to be able to use that at compile-time. The
macro is supposed to define some constants.
Just
On Wed, 06 Jul 2011 16:21:31 +0200, Trass3r wrote:
> Am 06.07.2011, 16:15 Uhr, schrieb teo :
>
>> What is the best way to translate following to D?
>>
>> #define MAKELONG(a, b) \
>> ((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16))
>>
>> The point is I would like to be able to use that a
The TYPESIZE macro is used within another macro which defines constants.
#define M(a,b,size) \
((a) << SHIFT_A) | \
((b) << SHIFT_B) | \
((size) << SHIFT_SIZE))
#define MM(a,b,type)M((a),(b),(TYPESIZE(type)))
Example:
#define C1MM(1, 2, struct A)
#define
On Thu, 07 Jul 2011 11:38:05 -0400, teo wrote:
On Wed, 06 Jul 2011 16:21:31 +0200, Trass3r wrote:
Am 06.07.2011, 16:15 Uhr, schrieb teo :
What is the best way to translate following to D?
#define MAKELONG(a, b) \
((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16))
The point is I wo
On Thu, 07 Jul 2011 17:54:40 +0200, Trass3r wrote:
>> The TYPESIZE macro is used within another macro which defines
>> constants. #define M(a,b,size) \
>> ((a) << SHIFT_A) | \
>> ((b) << SHIFT_B) | \
>> ((size) << SHIFT_SIZE))
>> #define MM(a,b,type) M((a),(b),(TYPESIZE(ty
On Thu, 07 Jul 2011 11:57:51 -0400, Steven Schveighoffer wrote:
> Well, I can't really say I understand the point of using this macro at
> all. sizeof is a builtin, and part of the C spec. Why not just use
> sizeof?
>
Well, have a look please at ioctl.h (linux). You will find the following
ma
On Thu, 07 Jul 2011 16:23:33 -0400, teo wrote:
On Thu, 07 Jul 2011 11:57:51 -0400, Steven Schveighoffer wrote:
Well, I can't really say I understand the point of using this macro at
all. sizeof is a builtin, and part of the C spec. Why not just use
sizeof?
Well, have a look please at ioc
On Fri, 08 Jul 2011 09:54:40 -0400, Steven Schveighoffer wrote:
> On Thu, 07 Jul 2011 16:23:33 -0400, teo wrote:
>
>> On Thu, 07 Jul 2011 11:57:51 -0400, Steven Schveighoffer wrote:
>>
>>> Well, I can't really say I understand the point of using this macro at
>>> all. sizeof is a builtin, and p
On Mon, 11 Jul 2011 09:21:53 -0400, teo wrote:
On Fri, 08 Jul 2011 09:54:40 -0400, Steven Schveighoffer wrote:
On Thu, 07 Jul 2011 16:23:33 -0400, teo wrote:
On Thu, 07 Jul 2011 11:57:51 -0400, Steven Schveighoffer wrote:
Well, I can't really say I understand the point of using this macr
>
> I think you may be confusing function templates with plain templates?
>
Yes, I was a bit confused by the syntax, but I found that type of
templates on page 281 in TDPL. That is an eponymous template.
Thanks.
11 matches
Mail list logo