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
11 changes: 3 additions & 8 deletions src/dmd/dtoh.d
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ import dmd.astcodegen;
import dmd.arraytypes;
import dmd.globals;
import dmd.identifier;
import dmd.json;
import dmd.mars;
import dmd.root.array;
import dmd.root.file;
import dmd.root.filename;
import dmd.root.rmem;
import dmd.visitor;
import dmd.tokens;

Expand Down Expand Up @@ -193,14 +188,14 @@ private void initialize()
}
}

void genCppHdrFiles(ref Modules ms)
extern(C++) void genCppHdrFiles(ref Modules ms)
{
initialize();

OutBuffer buf;
buf.writestring("#pragma once\n");
buf.printf("// Automatically generated by %s Compiler v%d\n", global.vendor.ptr, global.versionNumber());
buf.writeByte('\n');
buf.printf("// Automatically generated by dmd -HC\n");
buf.writestring("#pragma once\n");
buf.writeByte('\n');
buf.writestring("#include <assert.h>\n");
buf.writestring("#include <stddef.h>\n");
Expand Down
1 change: 1 addition & 0 deletions src/dmd/hdrgen.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
class Module;

void genhdrfile(Module *m);
void genCppHdrFiles(Modules &ms);
void moduleToBuffer(OutBuffer *buf, Module *m);
const char *parametersTypeToChars(ParameterList pl);
4 changes: 2 additions & 2 deletions test/compilable/dtoh_AliasDeclaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ REQUIRED_ARGS: -HC -c -o-
PERMUTE_ARGS:
TEST_OUTPUT:
---
#pragma once
// Automatically generated by Digital Mars D Compiler v$n$

// Automatically generated by dmd -HC
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down
4 changes: 2 additions & 2 deletions test/compilable/dtoh_AnonDeclaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ REQUIRED_ARGS: -HC -c -o-
PERMUTE_ARGS:
TEST_OUTPUT:
---
#pragma once
// Automatically generated by Digital Mars D Compiler v$n$

// Automatically generated by dmd -HC
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down
4 changes: 2 additions & 2 deletions test/compilable/dtoh_ClassDeclaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ REQUIRED_ARGS: -HC -c -o-
PERMUTE_ARGS:
TEST_OUTPUT:
---
#pragma once
// Automatically generated by Digital Mars D Compiler v$n$

// Automatically generated by dmd -HC
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down
4 changes: 2 additions & 2 deletions test/compilable/dtoh_StructDeclaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ REQUIRED_ARGS: -HC -c -o-
PERMUTE_ARGS:
TEST_OUTPUT:
---
#pragma once
// Automatically generated by Digital Mars D Compiler v$n$

// Automatically generated by dmd -HC
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down
4 changes: 2 additions & 2 deletions test/compilable/dtoh_TemplateDeclaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ REQUIRED_ARGS: -HC -c -o-
PERMUTE_ARGS:
TEST_OUTPUT:
---
#pragma once
// Automatically generated by Digital Mars D Compiler v$n$

// Automatically generated by dmd -HC
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down
4 changes: 2 additions & 2 deletions test/compilable/dtoh_VarDeclaration.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ REQUIRED_ARGS: -HC -c -o-
PERMUTE_ARGS:
TEST_OUTPUT:
---
#pragma once
// Automatically generated by Digital Mars D Compiler v$n$

// Automatically generated by dmd -HC
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down
4 changes: 2 additions & 2 deletions test/compilable/dtoh_enum.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ REQUIRED_ARGS: -HC -c -o-
PERMUTE_ARGS:
TEST_OUTPUT:
---
#pragma once
// Automatically generated by Digital Mars D Compiler v$n$

// Automatically generated by dmd -HC
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down
4 changes: 2 additions & 2 deletions test/compilable/dtoh_functions.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ REQUIRED_ARGS: -HC -c -o-
PERMUTE_ARGS:
TEST_OUTPUT:
---
#pragma once
// Automatically generated by Digital Mars D Compiler v$n$

// Automatically generated by dmd -HC
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down
4 changes: 2 additions & 2 deletions test/compilable/dtoh_unittest_block.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ REQUIRED_ARGS: -HC -c -o-
PERMUTE_ARGS:
TEST_OUTPUT:
---
#pragma once
// Automatically generated by Digital Mars D Compiler v$n$

// Automatically generated by dmd -HC
#pragma once

#include <assert.h>
#include <stddef.h>
Expand Down