mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-21 23:33:13 +01:00
First merge of 2.064 beta.
This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb. Doesn't build Phobos yet.
This commit is contained in:
committed by
Kai Nacke
parent
c400d180d2
commit
cb341586e3
@@ -7,12 +7,17 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "target.h"
|
||||
#include "gen/irstate.h"
|
||||
#include "mars.h"
|
||||
#include "mtype.h"
|
||||
#include <assert.h>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
int Target::ptrsize;
|
||||
int Target::realsize;
|
||||
@@ -49,3 +54,19 @@ unsigned Target::fieldalign (Type* type)
|
||||
// LDC_FIXME: Verify this.
|
||||
return type->alignsize();
|
||||
}
|
||||
|
||||
// sizes based on those from tollvm.cpp:DtoMutexType()
|
||||
unsigned Target::critsecsize()
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
// Return sizeof(RTL_CRITICAL_SECTION)
|
||||
return global.params.is64bit ? 40 : 24;
|
||||
#else
|
||||
if (global.params.targetTriple.isOSWindows())
|
||||
return global.params.is64bit ? 40 : 24;
|
||||
else if (global.params.targetTriple.getOS() == llvm::Triple::FreeBSD)
|
||||
return sizeof(size_t);
|
||||
else
|
||||
return sizeof(pthread_mutex_t);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user