Skip to content

Commit c6acc3d

Browse files
committed
add dgetcmd.d
1 parent f36e815 commit c6acc3d

File tree

8 files changed

+2140
-49
lines changed

8 files changed

+2140
-49
lines changed

dm/src/dmc/cc.d

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@ enum WM
6464
WM_undefined_inline = 30, // static inline not expanded or defined
6565
}
6666

67-
// Language for error messages
68-
enum LANG
69-
{
70-
LANGenglish,
71-
LANGgerman,
72-
LANGfrench,
73-
LANGjapanese,
74-
}
75-
76-
7767
static if (MEMMODELS == 1)
7868
{
7969
enum LARGEDATA = 0; // don't want 48 bit pointers
@@ -97,16 +87,21 @@ else
9787
//#include "list.h"
9888
//#include "vec.h"
9989

100-
//#if SPP
101-
//#define COMPILER "Preprocessor"
102-
//#define ACTIVITY "preprocessing..."
103-
//#elif HTOD
104-
//#define COMPILER ".h to D Migration Tool"
105-
//#define ACTIVITY "migrating..."
106-
//#else
107-
//#define COMPILER "C/C++ Compiler"
108-
//#define ACTIVITY "compiling..."
109-
//#endif
90+
version (SPP)
91+
{
92+
enum COMPILER = "Preprocessor";
93+
enum ACTIVITY = "preprocessing...";
94+
}
95+
else version (HTOD)
96+
{
97+
enum COMPILER = ".h to D Migration Tool";
98+
enum ACTIVITY = "migrating...";
99+
}
100+
else version (SCPP)
101+
{
102+
enum COMPILER = "C/C++ Compiler";
103+
enum ACTIVITY = "compiling...";
104+
}
110105

111106
//#ifdef DEBUG
112107
//# define debug(a) (a)

dm/src/dmc/cdef.d

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ extern (C++):
2222
@nogc:
2323
nothrow:
2424

25+
enum VERSION = "9.00.0"; // for banner and imbedding in .OBJ file
26+
enum VERSIONHEX = "0x900"; // for __DMC__ macro
27+
enum VERSIONINT = 0x900; // for precompiled headers and DLL version
28+
2529
version (SCPP)
2630
version = XVERSION;
2731
version (SPP)
@@ -77,6 +81,15 @@ enum
7781
//#define ATTR_CAN_IGNORE(a) (((a) & (ATTR_LINKMOD|ATTR_TYPEMOD|ATTR_FUNCINFO|ATTR_DATAINFO|ATTR_TRANSU)) == 0)
7882
//#define LNX_CHECK_ATTRIBUTES(a,x) assert(((a) & ~(x|ATTR_IGNORED|ATTR_WARNING)) == 0)
7983

84+
version (_WINDLL)
85+
enum SUFFIX = "nd";
86+
else version (_WIN64)
87+
enum SUFFIX = "a";
88+
else version (Win32)
89+
enum SUFFIX = "n";
90+
else
91+
enum SUFFIX = "";
92+
8093
// Generate cleanup code
8194
enum TERMCODE = 0;
8295

@@ -347,32 +360,45 @@ enum REGMAX = 29; // registers are numbered 0..10
347360
alias tym_t = uint; // data type big enough for type masks
348361
alias SYMIDX = int; // symbol table index
349362

350-
//#define _chkstack() (void)0
351363

352-
//#if _WINDLL
353-
///* We reference the required Windows-1252 encoding of the copyright symbol
354-
// by escaping its character code (0xA9) rather than directly embedding it in
355-
// the source text. The character code is invalid in UTF-8, which causes some
356-
// of our source-code preprocessing tools (e.g. tolf) to choke. */
357-
//#ifndef COPYRIGHT_SYMBOL
358-
//#define COPYRIGHT_SYMBOL "\xA9"
359-
//#endif
360-
//#define COPYRIGHT "Copyright " COPYRIGHT_SYMBOL " 2001 Digital Mars"
361-
//#else
362-
//#ifdef DEBUG
363-
//#define COPYRIGHT "Copyright (C) Digital Mars 2000-2017. All Rights Reserved.\n\
364-
//Written by Walter Bright\n\
365-
//*****BETA TEST VERSION*****"
366-
//#else
367-
//#if __linux__
368-
//#define COPYRIGHT "Copyright (C) Digital Mars 2000-2017. All Rights Reserved.\n\
369-
//Written by Walter Bright, Linux version by Pat Nelson"
370-
//#else
371-
//#define COPYRIGHT "Copyright (C) Digital Mars 2000-2017. All Rights Reserved.\n\
372-
//Written by Walter Bright"
373-
//#endif
374-
//#endif
375-
//#endif
364+
version (MARS)
365+
{
366+
}
367+
else
368+
{
369+
version (_WINDLL)
370+
{
371+
/* We reference the required Windows-1252 encoding of the copyright symbol
372+
by escaping its character code (0xA9) rather than directly embedding it in
373+
the source text. The character code is invalid in UTF-8, which causes some
374+
of our source-code preprocessing tools (e.g. tolf) to choke.
375+
*/
376+
enum COPYRIGHT_SYMBOL = "\xA9";
377+
enum COPYRIGHT = "Copyright " ~ COPYRIGHT_SYMBOL ~ " 2001 Digital Mars";
378+
}
379+
else
380+
{
381+
debug
382+
{
383+
enum COPYRIGHT = "Copyright (C) Digital Mars 2000-2017. All Rights Reserved.
384+
Written by Walter Bright
385+
*****BETA TEST VERSION*****";
386+
}
387+
else
388+
{
389+
version (linux)
390+
{
391+
enum COPYRIGHT = "Copyright (C) Digital Mars 2000-2017. All Rights Reserved.
392+
Written by Walter Bright, Linux version by Pat Nelson";
393+
}
394+
else
395+
{
396+
enum COPYRIGHT = "Copyright (C) Digital Mars 2000-2017. All Rights Reserved.
397+
Written by Walter Bright";
398+
}
399+
}
400+
}
401+
}
376402

377403
/**********************************
378404
* Configuration
@@ -699,7 +725,8 @@ struct Config
699725
enum THRESHMAX = 0xFFFF;
700726

701727
// Language for error messages
702-
enum LANG
728+
alias LANG = int;
729+
enum
703730
{ LANGenglish,
704731
LANGgerman,
705732
LANGfrench,

0 commit comments

Comments
 (0)