Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dmd/compiler.d
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern (C++) __gshared
* A data structure that describes a back-end compiler and implements
* compiler-specific actions.
*/
struct Compiler
extern (C++) struct Compiler
{
/**
* Generate C main() in response to seeing D main().
Expand Down
20 changes: 10 additions & 10 deletions src/dmd/complex.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module dmd.complex;

import dmd.root.ctfloat;

struct complex_t
extern (C++) struct complex_t
{
real_t re;
real_t im;
Expand All @@ -32,49 +32,49 @@ struct complex_t
this.im = im;
}

complex_t opBinary(string op)(complex_t y)
extern (D) complex_t opBinary(string op)(complex_t y)
if (op == "+")
{
return complex_t(re + y.re, im + y.im);
}

complex_t opBinary(string op)(complex_t y)
extern (D) complex_t opBinary(string op)(complex_t y)
if (op == "-")
{
return complex_t(re - y.re, im - y.im);
}

complex_t opUnary(string op)()
extern (D) complex_t opUnary(string op)()
if (op == "-")
{
return complex_t(-re, -im);
}

complex_t opBinary(string op)(complex_t y)
extern (D) complex_t opBinary(string op)(complex_t y)
if (op == "*")
{
return complex_t(re * y.re - im * y.im, im * y.re + re * y.im);
}

complex_t opBinaryRight(string op)(real_t x)
extern (D) complex_t opBinaryRight(string op)(real_t x)
if (op == "*")
{
return complex_t(x) * this;
}

complex_t opBinary(string op)(real_t y)
extern (D) complex_t opBinary(string op)(real_t y)
if (op == "*")
{
return this * complex_t(y);
}

complex_t opBinary(string op)(real_t y)
extern (D) complex_t opBinary(string op)(real_t y)
if (op == "/")
{
return this / complex_t(y);
}

complex_t opBinary(string op)(complex_t y)
extern (D) complex_t opBinary(string op)(complex_t y)
if (op == "/")
{
if (CTFloat.fabs(y.re) < CTFloat.fabs(y.im))
Expand All @@ -91,7 +91,7 @@ struct complex_t
}
}

bool opCast(T : bool)() const
extern (D) bool opCast(T : bool)() const
{
return re || im;
}
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/dclass.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ enum Abstract : int

/***********************************************************
*/
struct BaseClass
extern (C++) struct BaseClass
{
Type type; // (before semantic processing)

Expand Down
2 changes: 1 addition & 1 deletion src/dmd/dinterpret.d
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public extern (C++) void printCtfePerformanceStats()
/*********
* Typesafe PIMPL idiom so we can keep CompiledCtfeFunction private.
*/
struct CompiledCtfeFunctionPimpl
extern (C++) struct CompiledCtfeFunctionPimpl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an internal struct? I think this can be ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because in FuncDeclaration we store a CompiledCtfeFunctionPimpl member field which was manually re-written in the declaration.h header file as CompiledCtfeFunction * (link)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also feel that this should stay private, but this was the easiest solution I came up with. Open to suggestions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh... used in func.d, in a rather weird way when comparing against the existing C++ header.

{
private CompiledCtfeFunction* pimpl;
private alias pimpl this;
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/dmodule.d
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ extern (C++) final class Module : Package

/***********************************************************
*/
struct ModuleDeclaration
extern (C++) struct ModuleDeclaration
{
Loc loc;
Identifier id;
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/expression.d
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ extern (D) Expression doCopyOrMove(Scope *sc, Expression e, Type t = null)
* to serve essentially as a Variant that will sit on the stack
* during CTFE to reduce memory consumption.
*/
struct UnionExp
extern (C++) struct UnionExp
{
// yes, default constructor does nothing
extern (D) this(Expression e)
Expand Down
8 changes: 4 additions & 4 deletions src/dmd/globals.d
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ enum CppStdRevision : uint
}

// Put command line switches in here
struct Param
extern (C++) struct Param
{
bool obj = true; // write object file
bool link = true; // perform link
Expand Down Expand Up @@ -290,7 +290,7 @@ alias structalign_t = uint;
// other values are all powers of 2
enum STRUCTALIGN_DEFAULT = (cast(structalign_t)~0);

struct Global
extern (C++) struct Global
{
const(char)[] inifilename;
string mars_ext = "d";
Expand Down Expand Up @@ -446,7 +446,7 @@ struct Global
* This can be used to restore the state set by `_init` to its original
* state.
*/
void deinitialize()
extern (D) void deinitialize()
{
this = this.init;
}
Expand Down Expand Up @@ -492,7 +492,7 @@ struct Global
/**
Returns: the final defaultlibname based on the command-line parameters
*/
const(char)[] finalDefaultlibname() const
extern (D) const(char)[] finalDefaultlibname() const
{
return params.betterC ? null :
params.symdebug ? params.debuglibname : params.defaultlibname;
Expand Down
9 changes: 6 additions & 3 deletions src/dmd/id.d
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ import dmd.tokens;
*
* All static fields in this struct represents a specific predefined symbol.
*/
struct Id
extern (C++) struct Id
{
static __gshared:

mixin(msgtable.generate(&identifier));
extern (D)
{
mixin(msgtable.generate(&identifier));
}

/**
* Populates the identifier pool with all predefined symbols.
Expand All @@ -46,7 +49,7 @@ struct Id
* This can be used to restore the state set by `initialize` to its original
* state.
*/
void deinitialize()
extern (D) void deinitialize()
{
mixin(msgtable.generate(&deinitializer));
}
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/target.d
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import dmd.root.outbuffer;
* sizes since cross compiling is supported and would end up using the host
* sizes rather than the target sizes.
*/
struct Target
extern (C++) struct Target
{
// D ABI
uint ptrsize; /// size of a pointer in bytes
Expand Down