Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #93 from alexrp/master
Browse files Browse the repository at this point in the history
Don't abuse X86 and X86_64 to make bitness-based decisions; use D_LP64 instead.
  • Loading branch information
complexmath committed Dec 1, 2011
2 parents 29f33bf + 5712165 commit 70f5abd
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/core/stdc/inttypes.d
Expand Up @@ -192,7 +192,7 @@ enum _cstr SCNxFAST16 = "x";
enum _cstr SCNxFAST32 = "lx";
enum _cstr SCNxFAST64 = "llx";

version( X86_64 )
version( D_LP64 )
{
enum _cstr PRIdMAX = PRId64;
enum _cstr PRIiMAX = PRIi64;
Expand Down
2 changes: 1 addition & 1 deletion src/core/stdc/stdint.d
Expand Up @@ -60,7 +60,7 @@ alias uint uint_fast16_t;
alias uint uint_fast32_t;
alias ulong uint_fast64_t;

version( X86_64 )
version( D_LP64 )
{
alias long intptr_t;
alias ulong uintptr_t;
Expand Down
24 changes: 12 additions & 12 deletions src/core/sys/posix/sys/types.d
Expand Up @@ -169,28 +169,28 @@ pthread_t

version( linux )
{
version(X86)
version(D_LP64)
{
enum __SIZEOF_PTHREAD_ATTR_T = 36;
enum __SIZEOF_PTHREAD_MUTEX_T = 24;
enum __SIZEOF_PTHREAD_ATTR_T = 56;
enum __SIZEOF_PTHREAD_MUTEX_T = 40;
enum __SIZEOF_PTHREAD_MUTEXATTR_T = 4;
enum __SIZEOF_PTHREAD_COND_T = 48;
enum __SIZEOF_PTHREAD_CONDATTR_T = 4;
enum __SIZEOF_PTHREAD_RWLOCK_T = 32;
enum __SIZEOF_PTHREAD_RWLOCK_T = 56;
enum __SIZEOF_PTHREAD_RWLOCKATTR_T = 8;
enum __SIZEOF_PTHREAD_BARRIER_T = 20;
enum __SIZEOF_PTHREAD_BARRIER_T = 32;
enum __SIZEOF_PTHREAD_BARRIERATTR_T = 4;
}
else version(X86_64)
else
{
enum __SIZEOF_PTHREAD_ATTR_T = 56;
enum __SIZEOF_PTHREAD_MUTEX_T = 40;
enum __SIZEOF_PTHREAD_ATTR_T = 36;
enum __SIZEOF_PTHREAD_MUTEX_T = 24;
enum __SIZEOF_PTHREAD_MUTEXATTR_T = 4;
enum __SIZEOF_PTHREAD_COND_T = 48;
enum __SIZEOF_PTHREAD_CONDATTR_T = 4;
enum __SIZEOF_PTHREAD_RWLOCK_T = 56;
enum __SIZEOF_PTHREAD_RWLOCK_T = 32;
enum __SIZEOF_PTHREAD_RWLOCKATTR_T = 8;
enum __SIZEOF_PTHREAD_BARRIER_T = 32;
enum __SIZEOF_PTHREAD_BARRIER_T = 20;
enum __SIZEOF_PTHREAD_BARRIERATTR_T = 4;
}

Expand Down Expand Up @@ -254,7 +254,7 @@ version( linux )
}
else version( OSX )
{
version( X86_64 )
version( D_LP64 )
{
enum __PTHREAD_SIZE__ = 1168;
enum __PTHREAD_ATTR_SIZE__ = 56;
Expand All @@ -266,7 +266,7 @@ else version( OSX )
enum __PTHREAD_RWLOCK_SIZE__ = 192;
enum __PTHREAD_RWLOCKATTR_SIZE__ = 16;
}
else version( X86 )
else
{
enum __PTHREAD_SIZE__ = 596;
enum __PTHREAD_ATTR_SIZE__ = 36;
Expand Down
2 changes: 1 addition & 1 deletion src/object_.d
Expand Up @@ -42,7 +42,7 @@ private
//alias typeof(int.sizeof) size_t;
//alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t;

version(X86_64)
version(D_LP64)
{
alias ulong size_t;
alias long ptrdiff_t;
Expand Down
2 changes: 1 addition & 1 deletion src/rt/aaA.d
Expand Up @@ -104,7 +104,7 @@ struct AA

size_t aligntsize(size_t tsize)
{
version (X86_64)
version (D_LP64)
// Size of key needed to align value on 16 bytes
return (tsize + 15) & ~(15);
else

This comment has been minimized.

Copy link
@ibuclaw

ibuclaw Dec 2, 2011

Member

This change to AAs will also need to be applied to std.format if not already done so (see putAArray).

Expand Down
4 changes: 2 additions & 2 deletions src/rt/dmain2.d
Expand Up @@ -213,12 +213,12 @@ extern (C)
extern (C) void _d_hidden_func()
{
Object o;
version(X86)
version(D_InlineAsm_X86)
asm
{
mov o, EAX;
}
else version(X86_64)
else version(D_InlineAsm_X86_64)
asm
{
mov o, RDI;
Expand Down
2 changes: 1 addition & 1 deletion src/rt/memset.d
Expand Up @@ -33,7 +33,7 @@ short *_memset16(short *p, short value, size_t count)

int *_memset32(int *p, int value, size_t count)
{
version (X86)
version (D_InlineAsm_X86)
{
asm
{
Expand Down

0 comments on commit 70f5abd

Please sign in to comment.