Browse Source

Update GDCC to 0.13.2

ijon 3 years ago
parent
commit
691a7cde8d
69 changed files with 3118 additions and 938 deletions
  1. 1 1
      bin_win/gdcc/COMMIT
  2. 2 2
      bin_win/gdcc/README
  3. 93 95
      bin_win/gdcc/doc/Asm.txt
  4. 130 0
      bin_win/gdcc/doc/C-ext.txt
  5. 1 1
      bin_win/gdcc/doc/examples/ACS-ext.acs
  6. BIN
      bin_win/gdcc/gdcc-acc.exe
  7. BIN
      bin_win/gdcc/gdcc-ar-wad.exe
  8. BIN
      bin_win/gdcc/gdcc-as.exe
  9. BIN
      bin_win/gdcc/gdcc-cc.exe
  10. BIN
      bin_win/gdcc/gdcc-cpp.exe
  11. BIN
      bin_win/gdcc/gdcc-irdump.exe
  12. BIN
      bin_win/gdcc/gdcc-ld.exe
  13. BIN
      bin_win/gdcc/gdcc-makelib.exe
  14. BIN
      bin_win/gdcc/gdcc-ntsc.exe
  15. 20 3
      bin_win/gdcc/lib/inc/ACS/zdefs.acs
  16. 54 7
      bin_win/gdcc/lib/inc/ACS/zspecial.acs
  17. 20 2
      bin_win/gdcc/lib/inc/C/ACS_ZDoom/Native.h
  18. 28 3
      bin_win/gdcc/lib/inc/C/ACS_ZDoom/Special.h
  19. 21 4
      bin_win/gdcc/lib/inc/C/ACS_ZDoom/defs.h
  20. 5 1
      bin_win/gdcc/lib/inc/C/ACS_Zandronum/Native.h
  21. 8 0
      bin_win/gdcc/lib/inc/C/ACS_Zandronum/defs.h
  22. 573 0
      bin_win/gdcc/lib/inc/C/Doominati.h
  23. 241 0
      bin_win/gdcc/lib/inc/C/GDCC/HashMap.h
  24. 2 0
      bin_win/gdcc/lib/inc/C/bits/types.h
  25. 55 11
      bin_win/gdcc/lib/inc/C/inttypes.h
  26. 52 10
      bin_win/gdcc/lib/inc/C/limits.h
  27. 5 1
      bin_win/gdcc/lib/inc/C/setjmp.h
  28. 73 28
      bin_win/gdcc/lib/inc/C/stdfix.h
  29. 37 5
      bin_win/gdcc/lib/inc/C/stdint.h
  30. 4 4
      bin_win/gdcc/lib/inc/C/stdlib.h
  31. 13 0
      bin_win/gdcc/lib/inc/C/string.h
  32. 240 0
      bin_win/gdcc/lib/inc/C/wchar.h
  33. 29 8
      bin_win/gdcc/lib/src/libGDCC/alloc.c
  34. 21 0
      bin_win/gdcc/lib/src/libc/DGE/defs.asm
  35. 21 0
      bin_win/gdcc/lib/src/libc/ZDACS/defs.asm
  36. 108 108
      bin_win/gdcc/lib/src/libc/ZDACS/approx.asm
  37. 532 0
      bin_win/gdcc/lib/src/libc/fmemopen.c
  38. 95 422
      bin_win/gdcc/lib/src/libc/fopen.c
  39. 57 19
      bin_win/gdcc/lib/src/libc/format.c
  40. 46 46
      bin_win/gdcc/lib/src/libc/ZDACS/fpclassify.asm
  41. 9 9
      bin_win/gdcc/lib/src/libc/math.c
  42. 1 1
      bin_win/gdcc/lib/src/libc/printf.c
  43. 15 46
      bin_win/gdcc/lib/src/libc/stdlib.c
  44. 172 83
      bin_win/gdcc/lib/src/libc/string.c
  45. 16 16
      bin_win/gdcc/lib/src/libc/strto.c
  46. 7 2
      bin_win/gdcc/lib/src/libc/time.c
  47. 311 0
      bin_win/gdcc/lib/src/libc/wchar.c
  48. BIN
      bin_win/gdcc/libgcc_s_sjlj-1.dll
  49. BIN
      bin_win/gdcc/libgdcc-acc-lib.dll
  50. BIN
      bin_win/gdcc/libgdcc-ar-lib.dll
  51. BIN
      bin_win/gdcc/libgdcc-ar-wad-lib.dll
  52. BIN
      bin_win/gdcc/libgdcc-as-lib.dll
  53. BIN
      bin_win/gdcc/libgdcc-bc-dge-lib.dll
  54. BIN
      bin_win/gdcc/libgdcc-bc-lib.dll
  55. BIN
      bin_win/gdcc/libgdcc-bc-mgc-lib.dll
  56. BIN
      bin_win/gdcc/libgdcc-bc-zdacs-lib.dll
  57. BIN
      bin_win/gdcc/libgdcc-cc-lib.dll
  58. BIN
      bin_win/gdcc/libgdcc-core-lib.dll
  59. BIN
      bin_win/gdcc/libgdcc-cpp-lib.dll
  60. BIN
      bin_win/gdcc/libgdcc-ir-lib.dll
  61. BIN
      bin_win/gdcc/libgdcc-ld-lib.dll
  62. BIN
      bin_win/gdcc/libgdcc-ntsc-lib.dll
  63. BIN
      bin_win/gdcc/libgdcc-option-lib.dll
  64. BIN
      bin_win/gdcc/libgdcc-platform-lib.dll
  65. BIN
      bin_win/gdcc/libgdcc-sr-lib.dll
  66. BIN
      bin_win/gdcc/libgmp-10.dll
  67. BIN
      bin_win/gdcc/libgmpxx-4.dll
  68. BIN
      bin_win/gdcc/libstdc++-6.dll
  69. BIN
      bin_win/gdcc/libwinpthread-1.dll

+ 1 - 1
bin_win/gdcc/COMMIT

@@ -1 +1 @@
-bce3b6c9dfa1c87b857f2622b7b4c312463e38af
+a4cc08cffd0e4199f5d08d75ba4cf48dcd4494fc

+ 2 - 2
bin_win/gdcc/README

@@ -40,9 +40,9 @@ GDCC Linker (gdcc-ld)
 Linker program for converting intermediary representation files to bytecode.
 
 
-GDCC MageDefs (gdcc-magedefs)
+GDCC NTS Compiler (gdcc-ntsc)
 
-Processes plain text files into MageCraft NTS format by tokenizing.
+Processes plain text files into Doominati NTS format by tokenizing.
 
 
 GDCC MakeLib (gdcc-makelib)

+ 93 - 95
bin_win/gdcc/doc/Asm.txt

@@ -101,15 +101,17 @@ Syntax:
     <localReg> = expression
     <param> = expression
     <retrn> = expression
-    <sflagClS> = expression
-    <sflagNet> = expression
-    <stype> = script-type-specifier
+    <stype> = [ string-list(opt) ]
     <valueInt> = expression
     <valueStr> = string
 
   statement-list:
     statement statement-list(opt)
 
+  string-list:
+    string
+    string-list , string
+
 Semantics:
   Defines a function. This includes ACS scripts, which are distinguished by the
   call type.
@@ -524,10 +526,14 @@ Statement Names
 Syntax:
   statement-name:
     <Nop>
+    <AdXU_W>
     <AddF_W>
     <AddI_W>
     <AddU_W>
-    <AndU_W>
+    <BAnd_W>
+    <BNot_W>
+    <BOrI_W>
+    <BOrX_W>
     <Call>
     <Casm>
     <CmpF_EQ_W>
@@ -560,10 +566,12 @@ Syntax:
     <DivF_W>
     <DivI_W>
     <DivX_W>
-    <InvU_W>
     <Jcnd_Nil>
     <Jcnd_Tru>
     <Jump>
+    <LAnd>
+    <LNot>
+    <LOrI>
     <ModI_W>
     <Move_W>
     <MuXU_W>
@@ -572,9 +580,6 @@ Syntax:
     <MulX_W>
     <NegF_W>
     <NegI_W>
-    <NotU_W>
-    <OrIU_W>
-    <OrXU_W>
     <Pltn>
     <Retn>
     <ShLF_W>
@@ -603,7 +608,7 @@ AdXU_W (Expanding Add Unsigned Integer Word)
 
 Arguments:
   AdXU_W N, destination[N+1] dst, source[N] lop, source[N] rop
-  AdXU_W N, destination[N+1] dst, source[N] lop, source[N] rop, source[1] carry
+  AdXU_W N, destination[N+1] dst, source[1] carry, source[N] lop, source[N] rop
 
 Semantics:
   Adds rop to lop and stores the result with carry in dst.
@@ -625,16 +630,46 @@ Semantics:
   Adds rop to lop and stores the result in dst.
 
 -----------------------------------------------------------
-AndU_W (Bitwise And Unsigned Integer Word)
+BAnd_W (Bitwise And Word)
 -----------------------------------------------------------
 
 Arguments:
-  AndU_W N, desination[N] dst, source[N] lop, source[N] rop
+  BAnd_W N, desination[N] dst, source[N] lop, source[N] rop
 
 Semantics:
   Bitwise ands lop with rop and stores the result in dst.
 
 -----------------------------------------------------------
+BNot_W (Bitwise Invert Word)
+-----------------------------------------------------------
+
+Argument:
+  BNot_W N, destination[N] dst, source[N] src
+
+Semantics:
+  Bitwise inverts src and stores the result in dst.
+
+-----------------------------------------------------------
+BOrI_W (Bitwise Inclusive Or Word)
+-----------------------------------------------------------
+
+Arguments:
+  BOrI_W N, destination[N] dst, source[N] lop, source[N] rop
+
+Semantics:
+  Bitwise inclusive ors lop with rop and stores the result in dst.
+
+-----------------------------------------------------------
+BOrX_W (Bitwise Exclusive Or Word)
+-----------------------------------------------------------
+
+Arguments:
+  BOrX_W N, destination[N] dst, source[N] lop, source[N] rop
+
+Semantics:
+  Bitwise exclusive ors lop with rop and stores the result in dst.
+
+-----------------------------------------------------------
 Call
 -----------------------------------------------------------
 
@@ -767,16 +802,6 @@ Semantics:
   Divides lop by rop and stores the quotient in dst.
 
 -----------------------------------------------------------
-InvU_W (Bitwise Invert Unsigned Integer Word
------------------------------------------------------------
-
-Argument:
-  InvU_W N, destination[N] dst, source[N] src
-
-Semantics:
-  Bitwise inverts src and stores the result in dst.
-
------------------------------------------------------------
 Jcnd_Nil (Conditional Jump, Nil)
 Jcnd_Tru (Conditional Jump, True)
 -----------------------------------------------------------
@@ -842,6 +867,36 @@ Semantics:
   Branches execution to addr.
 
 -----------------------------------------------------------
+LAnd (Logical And)
+-----------------------------------------------------------
+
+Arguments:
+  LAnd N, destination[1] dst, source[N] lop, source[N] rop
+
+Semantics:
+  Logically ands lop with rop and stores the result in dst.
+
+-----------------------------------------------------------
+LNot (Logical Invert)
+-----------------------------------------------------------
+
+Arguments:
+  LNot N, destination[1] dst, source[N] src
+
+Semantics:
+  Logically inverts src and stores the result in dst.
+
+-----------------------------------------------------------
+LOrI (Logical Inclusive Or)
+-----------------------------------------------------------
+
+Arguments:
+  LOrI N, destination[1] dst, source[N] lop, source[N] rop
+
+Semantics:
+  Logically inclusive ors lop with rop and stores the result in dst.
+
+-----------------------------------------------------------
 ModI_W (Modulus Signed Integer Word)
 ModU_W (Modulus Unsigned Integer Word)
 -----------------------------------------------------------
@@ -900,36 +955,6 @@ Semantics:
   Negates src and stores the result in dst.
 
 -----------------------------------------------------------
-NotU_W (Logical Invert Unsigned Integer Word)
------------------------------------------------------------
-
-Arguments:
-  NotU_W N, destination[1] dst, source[N] src
-
-Semantics:
-  Logically inverts src and stores the result in dst.
-
------------------------------------------------------------
-OrIU_W (Bitwise Inclusive Or Unsigned Integer Word)
------------------------------------------------------------
-
-Arguments:
-  OrIU_W N, destination[N] dst, source[N] lop, source[N] rop
-
-Semantics:
-  Bitwise inclusive ors lop with rop and stores the result in dst.
-
------------------------------------------------------------
-OrXU_W (Bitwise Exclusive Or Unsigned Integer Word)
------------------------------------------------------------
-
-Arguments:
-  OrXU_W N, destination[N] dst, source[N] lop, source[N] rop
-
-Semantics:
-  Bitwise exclusive ors lop with rop and stores the result in dst.
-
------------------------------------------------------------
 Pltn (Pointer, Local To Near)
 -----------------------------------------------------------
 
@@ -989,7 +1014,7 @@ SuXU_W (Expanding Subtract Unsigned Integer Word)
 
 Arguments:
   SuXU_W N, destination[N+1] dst, source[N] lop, source[N] rop
-  SuXU_W N, destination[N+1] dst, source[N] lop, source[N] rop, source[1] carry
+  SuXU_W N, destination[N+1] dst, source[1] carry, source[N] lop, source[N] rop
 
 Semantics:
   Subtracts rop from lop and stores the result with carry in dst.
@@ -1444,22 +1469,6 @@ Syntax:
     <IntC>
     <IntCXX>
 
-  script-type-specifier:
-    <None>
-    <BlueReturn>
-    <Death>
-    <Disconnect>
-    <Enter>
-    <Event>
-    <Lightning>
-    <Open>
-    <Pickup>
-    <RedReturn>
-    <Respawn>
-    <Return>
-    <Unloading>
-    <WhiteReturn>
-
 ===============================================================================
 Grammar
 ===============================================================================
@@ -1509,12 +1518,17 @@ Grammar
     <localReg> = expression
     <param> = expression
     <retrn> = expression
-    <sflagClS> = expression
-    <sflagNet> = expression
-    <stype> = script-type-specifier
+    <stype> = [ string-list(opt) ]
     <valueInt> = expression
     <valueStr> = string
 
+  statement-list:
+    statement statement-list(opt)
+
+  string-list:
+    string
+    string-list , string
+
   glyph-declaration:
     <Glyph> string glyph-argument-list(opt) new-line
 
@@ -1586,9 +1600,6 @@ Grammar
     <valueInt> = expression
     <valueStr> = string
 
-  statement-list:
-    statement statement-list(opt)
-
   statement:
     statement-label-list(opt) statement-name expression argument-list(opt)
       new-line
@@ -1599,10 +1610,14 @@ Grammar
 
   statement-name:
     <Nop>
+    <AdXU_W>
     <AddF_W>
     <AddI_W>
     <AddU_W>
-    <AndU_W>
+    <BAnd_W>
+    <BNot_W>
+    <BOrI_W>
+    <BOrX_W>
     <Call>
     <Casm>
     <CmpF_EQ_W>
@@ -1633,10 +1648,12 @@ Grammar
     <DivF_W>
     <DivI_W>
     <DivX_W>
-    <InvU_W>
     <Jcnd_Nil>
     <Jcnd_Tru>
     <Jump>
+    <LAnd>
+    <LNot>
+    <LOrI>
     <ModI_W>
     <Move_W>
     <MulF_W>
@@ -1644,9 +1661,6 @@ Grammar
     <MulX_W>
     <NegF_W>
     <NegI_W>
-    <NotU_W>
-    <OrIU_W>
-    <OrXU_W>
     <Pltn>
     <Retn>
     <ShLF_W>
@@ -1991,22 +2005,6 @@ Grammar
     <IntC>
     <IntCXX>
 
-  script-type-specifier:
-    <None>
-    <BlueReturn>
-    <Death>
-    <Disconnect>
-    <Enter>
-    <Event>
-    <Lightning>
-    <Open>
-    <Pickup>
-    <RedReturn>
-    <Respawn>
-    <Return>
-    <Unloading>
-    <WhiteReturn>
-
 ###############################################################################
 EOF
 ###############################################################################

+ 130 - 0
bin_win/gdcc/doc/C-ext.txt

@@ -465,6 +465,95 @@ Semantics:
   __str_ent is a non-object type used to represent string table entries.
 
 ===========================================================
+Structure and Union Specifiers
+===========================================================
+
+Syntax:
+  struct-declaration: add
+    struct-property-declaration
+
+  struct-property-declaration:
+    <__prop> identifier { struct-property-list }
+
+  struct-property-list:
+    struct-property
+    struct-property-list , struct-property
+
+  struct-property:
+    struct-property-name : primary-expression (
+      struct-property-argument-list(opt) )
+
+  struct-property-name:
+    <call>
+    <get>
+    <set>
+    <__call>
+    <__get>
+    <__set>
+
+  struct-property-argument-list:
+    struct-property-argument
+    struct-property-argument-list , struct-property-argument
+
+  struct-property-argument:
+    <this>
+    <__arg>
+    <__this>
+    * <this>
+    * <__this>
+    -> identifier
+    constant-expression
+
+-----------------------------------------------------------
+Structure Property Declarations
+-----------------------------------------------------------
+
+Constraints:
+  In a struct property list, each struct property name (call, get, and set (or
+  their respective aliases, __call, __get, and __set)) shall appear at most
+  once.
+
+  The primary expression in a struct property shall be a constant expression.
+
+  In a struct property argument list, this (or its alias, __this) or
+  ->identifier shall appear at most once.
+
+Semantics:
+  Declares a structure member whose access is controlled by the specified
+  functions. Such a member is known as a structure property member.
+
+  An individual property is specified as a function and argument list. When
+  invoked, the function is passed that argument list with the following
+  substitutions made:
+    Each this is replaced with a pointer to the containing object.
+
+    Each *this is replaced with the containing object.
+
+    Each arg is replaced with a subsequent argument being passed to the
+    structure property expression.
+
+    Each ->identifier is replaced with the named member of the containing
+    object.
+  If there are any remaining arguments to the structure property expression,
+  they are added as if the argument list contained a corresponding number of
+  arg arguments.
+
+  When a structure property member is accessed, the result is evaluated
+  depending on context:
+    If subject to the call operator and there is a call property, then it is
+    invoked with the call expressions as arguments.
+
+    Otherwise, if subject to the call operator and there is no call property,
+    then the get property is invoked and the result is called.
+
+    Otherwise, if subject to the assignment operator, the set property is
+    invoked with the right expression as the argument.
+
+    Otherwise, if converted to an rvalue, the get property is invoked.
+
+    Otherwise, the expression has no type or value.
+
+===========================================================
 Type Qualifiers
 ===========================================================
 
@@ -544,6 +633,7 @@ Statements
 Syntax:
   statement: add
     asm-statement
+    with-statement
 
 ===========================================================
 Assembly Statement
@@ -557,6 +647,34 @@ Semantics:
   Passes the contents of the string literal to the IR assembler as a statement
   list.
 
+===========================================================
+With Statement
+===========================================================
+
+Syntax:
+  with-statement:
+    <__with> ( with-declaration-sequence(opt) ) statement
+
+  with-declaration-sequence:
+    with-declaration
+    with-declaration-sequence with-declaration
+
+  with-declaration:
+    declaration
+    expression ;
+
+Semantics:
+  The with statement creates a new scope for a single statement, with
+  declarations and expressions inserted in that new scope before the statement.
+
+  The statement
+    __with(X; Y;) Z;
+  is equivalent to
+    {X; Y; Z;}
+  with regards to scoping and lifetimes.
+
+  It is unspecified whether or not the with statement affects pragma scoping.
+
 ===============================================================================
 Pragma Directives
 ===============================================================================
@@ -849,10 +967,22 @@ Grammar
 
   statement: add
     asm-statement
+    with-statement
 
   asm-statement:
     <__asm> ( string-literal ) ;
 
+  with-statement:
+    <__with> ( with-declaration-sequence(opt) ) statement
+
+  with-declaration-sequence:
+    with-declaration
+    with-declaration-sequence with-declaration
+
+  with-declaration:
+    declaration
+    expression ;
+
   # <pragma> <ACS> <library> string-literal
 
   # <pragma> <GDCC> <FIXED_LITERAL> on-off-switch

+ 1 - 1
bin_win/gdcc/doc/examples/ACS-ext.acs

@@ -150,7 +150,7 @@ print CoolPrint
 function void PrintSomeStructs(SomeStruct ss1, SomeStruct ss2)
 {
    // Such declared print functions are used exactly like the standard ones.
-   Log(s: "ss1: ", ss: ss1, s: "; ss2: ", ss: ss2);
+   CoolPrint(s: "ss1: ", ss: ss1, s: "; ss2: ", ss: ss2);
 }
 
 // Do not forget to actually define forward declared functions. It can be

BIN
bin_win/gdcc/gdcc-acc.exe


BIN
bin_win/gdcc/gdcc-ar-wad.exe


BIN
bin_win/gdcc/gdcc-as.exe


BIN
bin_win/gdcc/gdcc-cc.exe


BIN
bin_win/gdcc/gdcc-cpp.exe


BIN
bin_win/gdcc/gdcc-irdump.exe


BIN
bin_win/gdcc/gdcc-ld.exe


BIN
bin_win/gdcc/gdcc-makelib.exe


BIN
bin_win/gdcc/gdcc-ntsc.exe


+ 20 - 3
bin_win/gdcc/lib/inc/ACS/zdefs.acs

@@ -225,6 +225,17 @@
 #define APROP_StencilColor     41
 #define APROP_Friction         42
 #define APROP_DamageMultiplier 43
+#define APROP_MaxStepHeight    44
+#define APROP_MaxDropOffHeight 45
+#define APROP_DamageType       46
+#define APROP_Counter0        100
+#define APROP_Counter1        101
+#define APROP_Counter2        102
+#define APROP_Counter3        103
+#define APROP_Counter4        104
+#define APROP_Counter5        105
+#define APROP_Counter6        106
+#define APROP_Counter7        107
 
 #define STYLE_None                0
 #define STYLE_Normal              1
@@ -273,6 +284,7 @@
 #define DAMAGE_NONPLAYERS         0x00000002
 #define DAMAGE_IN_AIR             0x00000004
 #define DAMAGE_SUBCLASSES_PROTECT 0x00000008
+#define DAMAGE_NO_ARMOR           0x00000010
 
 #define MRF_OLDEFFECTS        0x00000000
 #define MRF_ADDSTAMINA        0x00000001
@@ -490,6 +502,9 @@
 #define CHAN_VOICE       0x00000002
 #define CHAN_ITEM        0x00000003
 #define CHAN_BODY        0x00000004
+#define CHAN_5           0x00000005
+#define CHAN_6           0x00000006
+#define CHAN_7           0x00000007
 #define CHAN_LISTENERZ   0x00000008
 #define CHAN_MAYBE_LOCAL 0x00000010
 #define CHAN_UI          0x00000020
@@ -645,9 +660,11 @@
 #define FOGP_OUTSIDEDENSITY 1
 #define FOGP_SKYFOG         2
 
-#define PRINTNAME_LEVELNAME -1
-#define PRINTNAME_LEVEL     -2
-#define PRINTNAME_SKILL     -3
+#define PRINTNAME_LEVELNAME  -1
+#define PRINTNAME_LEVEL      -2
+#define PRINTNAME_SKILL      -3
+#define PRINTNAME_NEXTLEVEL  -4
+#define PRINTNAME_NEXTSECRET -5
 
 #define CSF_NOFAKEFLOORS 1
 #define CSF_NOBLOCKALL   2

+ 54 - 7
bin_win/gdcc/lib/inc/ACS/zspecial.acs

@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //
-// Copyright(C) 2015-2016 David Hill
+// Copyright(C) 2015-2017 David Hill
 //
 // See COPYLIB for license information.
 //
@@ -89,7 +89,7 @@ special
    int  14:Door_Animated(3,4),
    int  15:Autosave(0),
 // int  16:Transfer_WallLight,
-   int  17:Thing_Raise(1),
+   int  17:Thing_Raise(1,2),
    int  18:StartConversation(1,2),
    int  19:Thing_Stop(1),
    int  20:Floor_LowerByValue(3),
@@ -121,7 +121,7 @@ special
    int  46:Floor_CrushStop(1),
    int  47:Ceiling_MoveToValue(3,4),
 // int  48:Sector_Attach3dMidtex,
-   int  49:GlassBreak(0,1),
+   int  49:GlassBreak(0,2),
 // int  50:ExtraFloor_LightOnly,
    int  51:Sector_SetLink(4),
    int  52:Scroll_Wall(5),
@@ -178,6 +178,8 @@ special
 // int 103:Scroll_Texture_Down,
    int 104:Ceiling_CrushAndRaiseSilentDist(4,5),
 
+   int 107:Line_SetPortalTarget(2),
+
    int 109:Light_ForceLightning(1),
    int 110:Light_RaiseByValue(2),
    int 111:Light_LowerByValue(2),
@@ -304,13 +306,39 @@ special
    int 246:Elevator_MoveToFloor(2),
    int 247:Elevator_LowerToNearest(2),
    int 248:HealThing(1,2),
-   int 249:Door_CloseWaitOpen(3, 4),
+   int 249:Door_CloseWaitOpen(3,4),
    int 250:Floor_Donut(3),
    int 251:FloorAndCeiling_LowerRaise(3,4),
    int 252:Ceiling_RaiseToNearest(2),
    int 253:Ceiling_LowerToLowest(2),
    int 254:Ceiling_LowerToFloor(2),
    int 255:Ceiling_CrushRaiseAndStaySilA(4,5),
+   int 256:Floor_LowerToHighestEE(2,3),
+   int 257:Floor_RaiseToLowest(2,3),
+   int 258:Floor_LowerToLowestCeiling(2,3),
+   int 259:Floor_RaiseToCeiling(2,5),
+   int 260:Floor_ToCeilingInstant(1,4),
+   int 261:Floor_LowerByTexture(2,3),
+   int 262:Ceiling_RaiseToHighest(2,3),
+   int 263:Ceiling_ToHighestInstant(1,3),
+   int 264:Ceiling_LowerToNearest(2,4),
+   int 265:Ceiling_RaiseToLowest(2,3),
+   int 266:Ceiling_RaiseToHighestFloor(2,3),
+   int 267:Ceiling_ToFloorInstant(1,4),
+   int 268:Ceiling_RaiseByTexture(2,3),
+   int 269:Ceiling_LowerByTexture(2,4),
+   int 270:Stairs_BuildDownDoom(5),
+   int 271:Stairs_BuildUpDoomSync(4),
+   int 272:Stairs_BuildDownDoomSync(4),
+   int 273:Stairs_BuildUpDoomCrush(5),
+   int 274:Door_AnimatedClose(2),
+   int 275:Floor_Stop(1),
+   int 276:Ceiling_Stop(1),
+   int 277:Sector_SetFloorGlow(5),
+   int 278:Sector_SetCeilingGlow(5),
+
+// int 300:Portal_Define(5),
+// int 301:Line_QuickPortal(1),
 
    // internal functions have negative values
    int     -1:GetLineUDMFInt(2, int, str),
@@ -342,12 +370,14 @@ special
    int    -24:SetUserVariableFixed(3, int, str, fixed),
    int    -25:GetUserVariable(2, int, str),
    fixed  -25:GetUserVariableFixed(2, int, str),
+   str    -25:GetUserVariableString(2, int, str),
    int    -26:Radius_Quake2(6, int, int, int, int, int, str),
    int    -27:CheckActorClass(2, int, str),
    int    -28:SetUserArray(4, int, str, int, int),
    int    -28:SetUserArrayFixed(4, int, str, int, fixed),
    int    -29:GetUserArray(3, int, str, int),
    fixed  -29:GetUserArrayFixed(3, int, str, int),
+   str    -29:GetUserArrayString(3, int, str, int),
    int    -30:SoundSequenceOnActor(2, int, str),
    int    -31:SoundSequenceOnSector(3, int, str, int),
    int    -32:SoundSequenceOnPolyobj(2, int, str),
@@ -382,7 +412,7 @@ special
    str    -58:GetUserCVarString(2, int, str),
    int    -59:SetUserCVarString(3, int, str, str),
    int    -60:LineAttack(4, int, fixed, fixed, int, str, str, fixed, int, int),
-   int    -61:PlaySound(2, int, str, int, fixed, int, fixed),
+   int    -61:PlaySound(2, int, str, int, fixed, int, fixed, int),
    int    -62:StopSound(1, int, int),
    int    -63:StrCmp(2, str, str, int),
    int    -64:StrICmp(2, str, str, int),
@@ -458,12 +488,29 @@ special
    int   -123:BeginDBTransaction(0),
    int   -124:EndDBTransaction(0),
    int   -125:GetDBEntries(1, str),
-   int   -126:NamedRequestScriptPuke(4, str, int, int, int),
 
    // ZDoom's (continued)
    int   -200:CheckClass(1, str, int, int),
    int   -201:DamageActor(6, int, int, int, int, int, str),
-   int   -202:SetACtorFlag(3, int, str, int),
+   int   -202:SetActorFlag(3, int, str, int),
+   int   -203:SetTranslation(2, int, str),
+   str   -204:GetActorFloorTexture(1, int),
+   str   -205:GetActorFloorTerrain(1, int),
+   int   -206:StrArg(1, str),
+   fixed -207:Floor(1, fixed),
+   fixed -208:Round(1, fixed),
+   fixed -209:Ceil(1, fixed),
+   int   -210:ScriptCall(2, str, str, ...),
+   fixed -210:ScriptCallFixed(2, str, str, ...),
+   str   -210:ScriptCallString(2, str, str, ...),
+
+   // Eternity's
+   fixed -300:GetLineX(3, int, fixed, fixed),
+   fixed -301:GetLineY(3, int, fixed, fixed),
+
+   // GZDoom's
+   int   -400:SetSectorGlow(6, int, int, int, int, int, int),
+   int   -401:SetFogDensity(2, int, int),
 
    // ZDaemon's
    int -19260:GetTeamScore(1),

+ 20 - 2
bin_win/gdcc/lib/inc/C/ACS_ZDoom/Native.h

@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //
-// Copyright(C) 2014-2016 David Hill
+// Copyright(C) 2014-2017 David Hill
 //
 // See COPYLIB for license information.
 //
@@ -84,12 +84,14 @@ ACS_NativeDeclFull( 24, 0, int,    SetUserVariable, int, __str, int);
 ACS_NativeDeclFull( 24, 0, int,    SetUserVariableFixed, int, __str, _Accum);
 ACS_NativeDeclFull( 25, 0, int,    GetUserVariable, int, __str);
 ACS_NativeDeclFull( 25, 0, _Accum, GetUserVariableFixed, int, __str);
+ACS_NativeDeclFull( 25, 0, __str,  GetUserVariableString, int, __str);
 ACS_NativeDeclFull( 26, 0, int,    Radius_Quake2, int, int, int, int, int, __str);
 ACS_NativeDeclFull( 27, 0, int,    CheckActorClass, int, __str);
 ACS_NativeDeclFull( 28, 0, int,    SetUserArray, int, __str, int, int);
 ACS_NativeDeclFull( 28, 0, int,    SetUserArrayFixed, int, __str, int, _Accum);
 ACS_NativeDeclFull( 29, 0, int,    GetUserArray, int, __str, int);
 ACS_NativeDeclFull( 29, 0, _Accum, GetUserArrayFixed, int, __str, int);
+ACS_NativeDeclFull( 29, 0, __str,  GetUserArrayString, int, __str, int);
 ACS_NativeDeclFull( 30, 0, int,    SoundSequenceOnActor, int, __str);
 ACS_NativeDeclFull( 31, 0, int,    SoundSequenceOnSector, int, __str, int);
 ACS_NativeDeclFull( 32, 0, int,    SoundSequenceOnPolyobj, int, __str);
@@ -124,7 +126,7 @@ ACS_NativeDeclFull( 57, 0, int,    SetCVarString, __str, __str);
 ACS_NativeDeclFull( 58, 0, __str,  GetUserCVarString, int, __str);
 ACS_NativeDeclFull( 59, 0, int,    SetUserCVarString, int, __str, __str);
 ACS_NativeDeclFull( 60, 5, int,    LineAttack, int, _Accum, _Accum, int, __str, __str, _Accum, int, int);
-ACS_NativeDeclFull( 61, 4, int,    PlaySound, int, __str, int, _Accum, int, _Accum);
+ACS_NativeDeclFull( 61, 5, int,    PlaySound, int, __str, int, _Accum, int, _Accum, int);
 ACS_NativeDeclFull( 62, 1, int,    StopSound, int, int);
 ACS_NativeDeclFull( 63, 1, int,    StrCmp, __str, __str, int);
 ACS_NativeDeclFull( 64, 1, int,    StrCaseCmp, __str, __str, int);
@@ -170,6 +172,22 @@ ACS_NativeDeclFull( 99, 1, int,    CheckActorState, int, __str, int);
 ACS_NativeDeclFull(200, 2, int,    CheckClass, __str, int, int);
 ACS_NativeDeclFull(201, 0, int,    DamageActor, int, int, int, int, int, __str);
 ACS_NativeDeclFull(202, 0, int,    SetActorFlag, int, __str, int);
+ACS_NativeDeclFull(203, 0, int,    SetTranslation, int, __str);
+ACS_NativeDeclFull(204, 0, __str,  GetActorFloorTexture, int);
+ACS_NativeDeclFull(205, 0, __str,  GetActorFloorTerrain, int);
+ACS_NativeDeclFull(206, 0, int,    StrArg, __str);
+ACS_NativeDeclFull(207, 0, _Accum, Floor, _Accum);
+ACS_NativeDeclFull(208, 0, _Accum, Round, _Accum);
+ACS_NativeDeclFull(209, 0, _Accum, Ceil, _Accum);
+ACS_NativeDeclFull(210, 0, int,    ScriptCall, __str, __str, ...);
+ACS_NativeDeclFull(210, 0, _Accum, ScriptCallFixed, __str, __str, ...);
+ACS_NativeDeclFull(210, 0, __str,  ScriptCallString, __str, __str, ...);
+
+ACS_NativeDeclFull(300, 0, _Accum, GetLineX, int, _Accum, _Accum);
+ACS_NativeDeclFull(301, 0, _Accum, GetLineY, int, _Accum, _Accum);
+
+ACS_NativeDeclFull(400, 0, int,    SetSectorGlow, int, int, int, int, int, int);
+ACS_NativeDeclFull(401, 0, int,    SetFogDensity, int, int);
 
 #endif//__GDCC_Header__C__ACS_ZDoom__Native_h__
 

+ 28 - 3
bin_win/gdcc/lib/inc/C/ACS_ZDoom/Special.h

@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //
-// Copyright(C) 2014 David Hill
+// Copyright(C) 2014-2017 David Hill
 //
 // See COPYLIB for license information.
 //
@@ -25,7 +25,7 @@
 ACS_SpecialDeclFull( 14, 0, int, Door_Animated, int, int, int);
 ACS_SpecialDeclFull( 15, 0, int, Autosave, void);
 
-ACS_SpecialDeclFull( 17, 0, int, Thing_Raise, int);
+ACS_SpecialDeclFull( 17, 1, int, Thing_Raise, int, int);
 ACS_SpecialDeclFull( 18, 1, int, StartConversation, int, int);
 ACS_SpecialDeclFull( 19, 0, int, Thing_Stop, int);
 
@@ -38,7 +38,7 @@ ACS_SpecialDeclFull( 39, 0, int, Teleport_ZombieChanger, int, int);
 
 ACS_SpecialDeclFull( 47, 1, int, Ceiling_MoveToValue, int, int, int, int);
 
-ACS_SpecialDeclFull( 49, 1, int, GlassBreak, int);
+ACS_SpecialDeclFull( 49, 2, int, GlassBreak, int, int);
 
 ACS_SpecialDeclFull( 51, 0, int, Sector_SetLink, int, int, int, int);
 ACS_SpecialDeclFull( 52, 0, int, Scroll_Wall, int, int, int, int, int);
@@ -67,6 +67,8 @@ ACS_SpecialDeclFull( 98, 1, int, Sector_SetTranslucent, int, int, int, int);
 
 ACS_SpecialDeclFull(104, 1, int, Ceiling_CrushAndRaiseSilentDist, int, int, int, int, int);
 
+ACS_SpecialDeclFull(107, 0, int, Line_SetPortalTarget);
+
 ACS_SpecialDeclFull(117, 0, int, Light_Stop, int);
 
 ACS_SpecialDeclFull(119, 1, int, Thing_Damage, int, int, int);
@@ -172,6 +174,29 @@ ACS_SpecialDeclFull(252, 0, int, Ceiling_RaiseToNearest, int, int);
 ACS_SpecialDeclFull(253, 0, int, Ceiling_LowerToLowest, int, int);
 ACS_SpecialDeclFull(254, 0, int, Ceiling_LowerToFloor, int, int);
 ACS_SpecialDeclFull(255, 1, int, Ceiling_CrushRaiseAndStaySilA, int, int, int, int, int);
+ACS_SpecialDeclFull(256, 1, int, Floor_LowerToHighestEE, int, int, int);
+ACS_SpecialDeclFull(257, 1, int, Floor_RaiseToLowest, int, int, int);
+ACS_SpecialDeclFull(258, 1, int, Floor_LowerToLowestCeiling, int, int, int);
+ACS_SpecialDeclFull(259, 3, int, Floor_RaiseToCeiling, int, int, int, int, int);
+ACS_SpecialDeclFull(260, 3, int, Floor_ToCeilingInstant, int, int, int, int);
+ACS_SpecialDeclFull(261, 1, int, Floor_LowerByTexture, int, int, int);
+ACS_SpecialDeclFull(262, 1, int, Ceiling_RaiseToHighest, int, int, int);
+ACS_SpecialDeclFull(263, 2, int, Ceiling_ToHighestInstant, int, int, int);
+ACS_SpecialDeclFull(264, 2, int, Ceiling_LowerToNearest, int, int, int, int);
+ACS_SpecialDeclFull(265, 1, int, Ceiling_RaiseToLowest, int, int, int);
+ACS_SpecialDeclFull(266, 1, int, Ceiling_RaiseToHighestFloor, int, int, int);
+ACS_SpecialDeclFull(267, 3, int, Ceiling_ToFloorInstant, int, int, int, int);
+ACS_SpecialDeclFull(268, 1, int, Ceiling_RaiseByTexture, int, int, int);
+ACS_SpecialDeclFull(269, 2, int, Ceiling_LowerByTexture, int, int, int, int);
+ACS_SpecialDeclFull(270, 0, int, Stairs_BuildDownDoom, int, int, int, int, int);
+ACS_SpecialDeclFull(271, 0, int, Stairs_BuildUpDoomSync, int, int, int, int);
+ACS_SpecialDeclFull(272, 0, int, Stairs_BuildDownDoomSync, int, int, int, int);
+ACS_SpecialDeclFull(273, 0, int, Stairs_BuildUpDoomCrush, int, int, int, int, int);
+ACS_SpecialDeclFull(274, 0, int, Door_AnimatedClose, int, int);
+ACS_SpecialDeclFull(275, 0, int, Floor_Stop, int);
+ACS_SpecialDeclFull(276, 0, int, Ceiling_Stop, int);
+ACS_SpecialDeclFull(277, 0, int, Sector_SetFloorGlow, int, int, int, int, int);
+ACS_SpecialDeclFull(278, 0, int, Sector_SetCeilingGlow, int, int, int, int, int);
 
 #endif//__GDCC_Header__C__ACS_ZDoom__Special_h__
 

+ 21 - 4
bin_win/gdcc/lib/inc/C/ACS_ZDoom/defs.h

@@ -218,13 +218,24 @@
 #define APROP_Stamina          34
 #define APROP_Height           35
 #define APROP_Radius           36
-#define APROP_Reactiontime     37
+#define APROP_ReactionTime     37
 #define APROP_MeleeRange       38
 #define APROP_ViewHeight       39
 #define APROP_AttackZOffset    40
 #define APROP_StencilColor     41
 #define APROP_Friction         42
 #define APROP_DamageMultiplier 43
+#define APROP_MaxStepHeight    44
+#define APROP_MaxDropOffHeight 45
+#define APROP_DamageType       46
+#define APROP_Counter0        100
+#define APROP_Counter1        101
+#define APROP_Counter2        102
+#define APROP_Counter3        103
+#define APROP_Counter4        104
+#define APROP_Counter5        105
+#define APROP_Counter6        106
+#define APROP_Counter7        107
 
 #define STYLE_None                0
 #define STYLE_Normal              1
@@ -273,6 +284,7 @@
 #define DAMAGE_NONPLAYERS         0x00000002
 #define DAMAGE_IN_AIR             0x00000004
 #define DAMAGE_SUBCLASSES_PROTECT 0x00000008
+#define DAMAGE_NO_ARMOR           0x00000010
 
 #define MRF_OLDEFFECTS        0x00000000
 #define MRF_ADDSTAMINA        0x00000001
@@ -490,6 +502,9 @@
 #define CHAN_VOICE       0x00000002
 #define CHAN_ITEM        0x00000003
 #define CHAN_BODY        0x00000004
+#define CHAN_5           0x00000005
+#define CHAN_6           0x00000006
+#define CHAN_7           0x00000007
 #define CHAN_LISTENERZ   0x00000008
 #define CHAN_MAYBE_LOCAL 0x00000010
 #define CHAN_UI          0x00000020
@@ -645,9 +660,11 @@
 #define FOGP_OUTSIDEDENSITY 1
 #define FOGP_SKYFOG         2
 
-#define PRINTNAME_LEVELNAME -1
-#define PRINTNAME_LEVEL     -2
-#define PRINTNAME_SKILL     -3
+#define PRINTNAME_LEVELNAME  -1
+#define PRINTNAME_LEVEL      -2
+#define PRINTNAME_SKILL      -3
+#define PRINTNAME_NEXTLEVEL  -4
+#define PRINTNAME_NEXTSECRET -5
 
 #define CSF_NOFAKEFLOORS 1
 #define CSF_NOBLOCKALL   2

+ 5 - 1
bin_win/gdcc/lib/inc/C/ACS_Zandronum/Native.h

@@ -52,10 +52,14 @@ ACS_NativeDeclFull(119, 0, __str,  GetDBResultValueString, int, int);
 ACS_NativeDeclFull(120, 0, int,    GetDBResultValue, int, int);
 ACS_NativeDeclFull(120, 0, _Accum, GetDBResultValueFixed, int, int);
 ACS_NativeDeclFull(121, 0, int,    GetDBEntryRank, __str, __str, int);
-ACS_NativeDeclFull(122, 0, int,    RequestScriptPuke, int, int, int, int);
+ACS_NativeDeclFull(122, 0, int,    RequestScriptPuke, int, int, int, int, int);
 ACS_NativeDeclFull(123, 0, int,    BeginDBTransaction, void);
 ACS_NativeDeclFull(124, 0, int,    EndDBTransaction, void);
 ACS_NativeDeclFull(125, 0, int,    GetDBEntries, __str);
+ACS_NativeDeclFull(126, 0, int,    NamedRequestScriptPuke, __str, int, int, int, int);
+ACS_NativeDeclFull(127, 0, int,    SystemTime, void);
+ACS_NativeDeclFull(128, 0, int,    GetTimeProperty, int, int, int);
+ACS_NativeDeclFull(129, 0, __str,  Strftime, int, __str, int);
 
 #endif//__GDCC_Header__C__ACS_Zandronum__Native_h__
 

+ 8 - 0
bin_win/gdcc/lib/inc/C/ACS_Zandronum/defs.h

@@ -93,5 +93,13 @@
 #define DB_ORDER_ASC  0
 #define DB_ORDER_DESC 1
 
+#define TM_SECOND  0
+#define TM_MINUTE  1
+#define TM_HOUR    2
+#define TM_DAY     3
+#define TM_MONTH   4
+#define TM_YEAR    5
+#define TM_WEEKDAY 6
+
 #endif//__GDCC_Header__C__ACS_Zandronum__defs_h__
 

+ 573 - 0
bin_win/gdcc/lib/inc/C/Doominati.h

@@ -0,0 +1,573 @@
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2016-2017 David Hill
+//
+// See COPYLIB for license information.
+//
+//-----------------------------------------------------------------------------
+//
+// Header for target library libdge.
+//
+// Doominati confirmed.
+//
+//-----------------------------------------------------------------------------
+
+#ifndef __GDCC_Header__C__Doominati_h__
+#define __GDCC_Header__C__Doominati_h__
+
+
+//----------------------------------------------------------------------------|
+// Macros                                                                     |
+//
+
+#define DGE_GlobalSound 1
+
+//
+// DGE_CB_*
+//
+#if __GDCC__
+#define DGE_CB(cb) (__glyph(unsigned, "{Callback}" #cb))
+#else
+#define DGE_CB(cb) 0
+#endif
+#define DGE_CB_Draw     DGE_CB(Draw)
+#define DGE_CB_DrawPost DGE_CB(DrawPost)
+#define DGE_CB_DrawPre  DGE_CB(DrawPre)
+#define DGE_CB_Resize   DGE_CB(Resize)
+
+//
+// DGE_Callback
+//
+#if __GDCC__
+#define DGE_Callback [[call("StkCall")]]
+#else
+#define DGE_Callback
+#endif
+
+//
+// DGE_Native
+//
+#if __GDCC__
+#define DGE_Native [[call("Native")]]
+#else
+#define DGE_Native
+#endif
+
+//
+// DGE_OM_*
+//
+// Object Member macros.
+//
+#if __GDCC__
+#define DGE_OM(mem) (__glyph(unsigned, "{ObjectMember}" #mem))
+#else
+#define DGE_OM(mem) 0
+#endif
+#define DGE_OM_bvx      DGE_OM(bvx)
+#define DGE_OM_bvy      DGE_OM(bvy)
+#define DGE_OM_bvz      DGE_OM(bvz)
+#define DGE_OM_damage   DGE_OM(damage)
+#define DGE_OM_entfi    DGE_OM(entfi)
+#define DGE_OM_entla    DGE_OM(entla)
+#define DGE_OM_frictair DGE_OM(frictair)
+#define DGE_OM_friction DGE_OM(friction)
+#define DGE_OM_grabx    DGE_OM(grabx)
+#define DGE_OM_graby    DGE_OM(graby)
+#define DGE_OM_grabz    DGE_OM(grabz)
+#define DGE_OM_gx       DGE_OM(gx)
+#define DGE_OM_gy       DGE_OM(gy)
+#define DGE_OM_gz       DGE_OM(gz)
+#define DGE_OM_health   DGE_OM(health)
+#define DGE_OM_id       DGE_OM(id)
+#define DGE_OM_mass     DGE_OM(mass)
+#define DGE_OM_next     DGE_OM(next)
+#define DGE_OM_owner    DGE_OM(owner)
+#define DGE_OM_pc       DGE_OM(pc)
+#define DGE_OM_pitch    DGE_OM(pitch)
+#define DGE_OM_prev     DGE_OM(prev)
+#define DGE_OM_rsx      DGE_OM(rsx)
+#define DGE_OM_rsy      DGE_OM(rsy)
+#define DGE_OM_sprite   DGE_OM(sprite)
+#define DGE_OM_sx       DGE_OM(sx)
+#define DGE_OM_sy       DGE_OM(sy)
+#define DGE_OM_sz       DGE_OM(sz)
+#define DGE_OM_team     DGE_OM(team)
+#define DGE_OM_teamfi   DGE_OM(teamfi)
+#define DGE_OM_teamla   DGE_OM(teamla)
+#define DGE_OM_teamne   DGE_OM(teamne)
+#define DGE_OM_teampr   DGE_OM(teampr)
+#define DGE_OM_texc     DGE_OM(texc)
+#define DGE_OM_texf     DGE_OM(texf)
+#define DGE_OM_vx       DGE_OM(vx)
+#define DGE_OM_vy       DGE_OM(vy)
+#define DGE_OM_vz       DGE_OM(vz)
+#define DGE_OM_x        DGE_OM(x)
+#define DGE_OM_xh       DGE_OM(xh)
+#define DGE_OM_xl       DGE_OM(xl)
+#define DGE_OM_y        DGE_OM(y)
+#define DGE_OM_yh       DGE_OM(yh)
+#define DGE_OM_yl       DGE_OM(yl)
+#define DGE_OM_yaw      DGE_OM(yaw)
+#define DGE_OM_z        DGE_OM(z)
+#define DGE_OM_zh       DGE_OM(zh)
+#define DGE_OM_zl       DGE_OM(zl)
+
+//
+// DGE_OT_*
+//
+// Object Type macros.
+//
+#if __GDCC__
+#define DGE_OT(type) (__glyph(unsigned, "{ObjectType}" #type))
+#else
+#define DGE_OT(type) 0
+#endif
+#define DGE_OT_Object              DGE_OT(Object)
+# define DGE_OT_Sector             DGE_OT(Sector)
+# define DGE_OT_Team               DGE_OT(Team)
+# define DGE_OT_Thinker            DGE_OT(Thinker)
+#  define DGE_OT_PointThinker      DGE_OT(PointThinker)
+#   define DGE_OT_RenderThinker    DGE_OT(RenderThinker)
+#    define DGE_OT_PhysicsThinker  DGE_OT(PhysicsThinker)
+#     define DGE_OT_Entity         DGE_OT(Entity)
+#      define DGE_OT_MissileEntity DGE_OT(MissileEntity)
+
+//
+// DGE_Object_MemberGet
+//
+#define DGE_Object_MemberGet(T, ...) \
+   _Generic((T)0, \
+      int:         DGE_Object_MemberGetI, \
+      DGE_ULFract: DGE_Object_MemberGetLA, \
+      DGE_LFract:  DGE_Object_MemberGetLR, \
+      unsigned:    DGE_Object_MemberGetU, \
+        DGE_Accum: DGE_Object_MemberGetX \
+   )(__VA_ARGS__)
+
+//
+// DGE_Object_MemberSet
+//
+#define DGE_Object_MemberSet(T, ...) \
+   _Generic((T)0, \
+      int:         DGE_Object_MemberSetI, \
+      DGE_ULFract: DGE_Object_MemberSetLA, \
+      DGE_LFract:  DGE_Object_MemberSetLR, \
+      unsigned:    DGE_Object_MemberSetU, \
+      DGE_Accum:   DGE_Object_MemberSetX \
+   )(__VA_ARGS__)
+
+//
+// DGE_OptArgs
+//
+#if __GDCC__
+#define DGE_OptArgs(n) [[optional_args(n)]]
+#else
+#define DGE_OptArgs(n)
+#endif
+
+//
+// DGE_PropMem
+//
+#if __GDCC__
+#define DGE_PropMem(T, name) \
+   __prop name {__get: DGE_Object_MemberGet(T, ->id, DGE_OM_##name), \
+                __set: DGE_Object_MemberSet(T, ->id, DGE_OM_##name)}
+#else
+#define DGE_PropMem(T, name) T name;
+#endif
+
+
+//----------------------------------------------------------------------------|
+// Types                                                                      |
+//
+
+//
+// DGE_Accum
+//
+#if __GDCC__
+typedef short _Accum DGE_Accum;
+#else
+typedef int DGE_Accum;
+#endif
+
+//
+// DGE_CallbackType
+//
+typedef void (*DGE_CallbackType)(void) DGE_Callback;
+
+//
+// DGE_LFract
+//
+#if __GDCC__
+typedef long _Fract DGE_LFract;
+#else
+typedef int DGE_LFract;
+#endif
+
+//
+// DGE_String
+//
+#if __GDCC__
+typedef __str DGE_String;
+#else
+typedef unsigned DGE_String;
+#endif
+
+//
+// DGE_ULFract
+//
+#if __GDCC__
+typedef unsigned long _Fract DGE_ULFract;
+#else
+typedef unsigned DGE_ULFract;
+#endif
+
+enum // DGE_Align
+{
+   DGE_Align_Keep,
+
+   DGE_Align_Left = 1,
+   DGE_Align_Right,
+   DGE_Align_Center,
+   DGE_Align_RightBox,
+   DGE_Align_CenterBox,
+
+   DGE_Align_Top = 1,
+   DGE_Align_Bottom,
+ //DGE_Align_Center,
+};
+
+enum // DGE_Axis
+{
+   DGE_Axis_X,
+   DGE_Axis_Y,
+};
+
+enum // DGE_Button
+{
+   DGE_Button1 = 1 << 0,
+   DGE_Button2 = 1 << 1,
+   DGE_Button3 = 1 << 2,
+   DGE_Button4 = 1 << 3,
+   DGE_Button5 = 1 << 4,
+   DGE_Button6 = 1 << 5,
+   DGE_Button7 = 1 << 6,
+   DGE_Button8 = 1 << 7,
+};
+
+typedef struct DGE_Point2
+{
+   DGE_Accum x, y;
+} DGE_Point2;
+
+typedef struct DGE_Point2I
+{
+   int x, y;
+} DGE_Point2I;
+
+struct DGE_Object;
+ struct DGE_Sector;
+ struct DGE_Team;
+ struct DGE_Thinker;
+  struct DGE_PointThinker;
+   struct DGE_RenderThinker;
+    struct DGE_PhysicsThinker;
+     struct DGE_Entity;
+      struct DGE_MissileEntity;
+
+
+//----------------------------------------------------------------------------|
+// Extern Functions                                                           |
+//
+
+DGE_Native unsigned DGE_BlockMap_Find(DGE_Accum xl, DGE_Accum yl, DGE_Accum xh, DGE_Accum yh);
+DGE_Native unsigned DGE_BlockMap_FindAll(void);
+DGE_Native unsigned DGE_BlockMap_FindCountSector(unsigned find);
+DGE_Native unsigned DGE_BlockMap_FindCountThinker(unsigned find);
+DGE_Native void DGE_BlockMap_FindFree(unsigned find);
+DGE_Native unsigned DGE_BlockMap_FindGetSector(unsigned find, unsigned idx);
+DGE_Native unsigned DGE_BlockMap_FindGetThinker(unsigned find, unsigned idx);
+DGE_Native void DGE_BlockMap_Split(DGE_Accum minSize, unsigned maxObj);
+
+DGE_Native void DGE_Callback_Register(unsigned cb, DGE_CallbackType fn);
+DGE_Native void DGE_Callback_Unregister(unsigned cb, DGE_CallbackType fn);
+
+DGE_Native unsigned DGE_CreateShaderData(DGE_String name, char const *frag, char const *vert);
+DGE_Native unsigned DGE_CreateShaderFile(DGE_String name, char const *frag, char const *vert);
+
+DGE_Native void DGE_DebugCallStk(void);
+DGE_OptArgs(1)
+DGE_Native void DGE_DebugDataStk(int dump);
+DGE_Native void DGE_DebugLocReg(void);
+
+DGE_Native void DGE_DopplerSpeed(DGE_Accum meterspersecond);
+
+DGE_OptArgs(1)
+DGE_Native void DGE_DrawColor(DGE_ULFract r, DGE_ULFract g, DGE_ULFract b, DGE_ULFract a);
+DGE_Native void DGE_DrawCircle(DGE_Accum x, DGE_Accum y, DGE_Accum r);
+DGE_Native void DGE_DrawCircleLine(DGE_Accum x, DGE_Accum y, DGE_Accum r);
+DGE_Native void DGE_DrawCirclePrecision(int subdivisions);
+DGE_Native void DGE_DrawEllipse(DGE_Accum x1, DGE_Accum y1, DGE_Accum x2, DGE_Accum y2);
+DGE_Native void DGE_DrawEllipseLine(DGE_Accum x1, DGE_Accum y1, DGE_Accum x2, DGE_Accum y2);
+DGE_Native void DGE_DrawRectangle(DGE_Accum x1, DGE_Accum y1, DGE_Accum x2, DGE_Accum y2);
+DGE_Native void DGE_DrawRectangleLine(DGE_Accum x1, DGE_Accum y1, DGE_Accum x2, DGE_Accum y2);
+DGE_Native void DGE_DrawShader(unsigned shd);
+DGE_Native void DGE_DrawLine(DGE_Accum x1, DGE_Accum y1, DGE_Accum x2, DGE_Accum y2);
+DGE_Native void DGE_DrawLineSmooth(unsigned on);
+DGE_Native void DGE_DrawLineWidth(int width);
+DGE_Native void DGE_DrawText(DGE_Accum x, DGE_Accum y, char const *str);
+DGE_Native void DGE_DrawTexture(unsigned tex);
+DGE_Native void DGE_DrawTriangle(DGE_Accum x1, DGE_Accum y1, DGE_Accum x2, DGE_Accum y2, DGE_Accum x3, DGE_Accum y3);
+DGE_Native void DGE_DrawTriangleLine(DGE_Accum x1, DGE_Accum y1, DGE_Accum x2, DGE_Accum y2, DGE_Accum x3, DGE_Accum y3);
+
+DGE_Native unsigned DGE_Entity_Create(unsigned ext);
+
+DGE_Native void DGE_FileClose(int fd);
+DGE_Native int DGE_FileGet(int fd, unsigned idx);
+DGE_Native int DGE_FileOpen(char const *name);
+DGE_Native int DGE_FileRead(int fd, unsigned idx, char *buf, unsigned len);
+DGE_Native unsigned DGE_FileSize(int fd);
+
+DGE_Native void *DGE_FreestoreBegin(void);
+DGE_Native void *DGE_FreestoreEnd(void);
+
+DGE_Native DGE_LFract DGE_GetInputAxis(unsigned num, unsigned axis);
+DGE_Native unsigned DGE_GetInputButtons(void);
+DGE_Native DGE_Point2I DGE_GetInputCursor(void);
+DGE_Native unsigned DGE_GetSound(DGE_String name);
+DGE_Native unsigned DGE_GetShader(DGE_String name);
+DGE_Native unsigned DGE_GetTexture(DGE_String name);
+
+DGE_Native unsigned DGE_MissileEntity_Create(unsigned ext);
+
+DGE_Native unsigned DGE_Object_Cast(unsigned id, unsigned type);
+DGE_Native int DGE_Object_MemberGetI(unsigned id, unsigned mem);
+DGE_Native DGE_ULFract DGE_Object_MemberGetLA(unsigned id, unsigned mem);
+DGE_Native DGE_LFract DGE_Object_MemberGetLR(unsigned id, unsigned mem);
+DGE_Native unsigned DGE_Object_MemberGetU(unsigned id, unsigned mem);
+DGE_Native DGE_Accum DGE_Object_MemberGetX(unsigned id, unsigned mem);
+DGE_Native void DGE_Object_MemberSetI(unsigned id, unsigned mem, int val);
+DGE_Native void DGE_Object_MemberSetLA(unsigned id, unsigned mem, DGE_ULFract val);
+DGE_Native void DGE_Object_MemberSetLR(unsigned id, unsigned mem, DGE_LFract val);
+DGE_Native void DGE_Object_MemberSetU(unsigned id, unsigned mem, unsigned val);
+DGE_Native void DGE_Object_MemberSetX(unsigned id, unsigned mem, DGE_Accum val);
+DGE_Native void DGE_Object_RefAdd(unsigned id);
+DGE_Native void DGE_Object_RefSub(unsigned id);
+
+DGE_Native void DGE_PhysicsThinker_Block(unsigned id);
+DGE_Native unsigned DGE_PhysicsThinker_Create(unsigned ext);
+DGE_Native void DGE_PhysicsThinker_Unblock(unsigned id);
+
+DGE_Native unsigned DGE_PointThinker_Create(unsigned ext);
+
+DGE_Native void DGE_PrintChar(unsigned c);
+DGE_Native void DGE_PrintWordD(unsigned d);
+
+DGE_Native unsigned DGE_RenderThinker_Create(unsigned ext);
+
+DGE_Native void DGE_Sector_Block(unsigned id);
+DGE_Native void DGE_Sector_CalcBounds(unsigned id);
+DGE_Native unsigned DGE_Sector_Create(unsigned pc, unsigned ext);
+DGE_Native DGE_Point2 DGE_Sector_PointGet(unsigned id, unsigned p);
+DGE_Native void DGE_Sector_PointSet(unsigned id, unsigned p, DGE_Point2 val);
+DGE_Native void DGE_Sector_Unblock(unsigned id);
+
+DGE_Native void DGE_SetViewpoint(unsigned id);
+DGE_Native void DGE_SetVirtualResolution(unsigned w, unsigned h);
+DGE_Native void DGE_SetWindowTitle(char const *str);
+
+DGE_Native void DGE_SoundChanLoop(unsigned src, unsigned chan, unsigned on);
+DGE_OptArgs(1)
+DGE_Native void DGE_SoundChanPitch(unsigned src, unsigned chan, DGE_ULFract pitch);
+DGE_Native void DGE_SoundChanPlay(unsigned src, unsigned chan);
+DGE_Native void DGE_SoundChanPosition(unsigned src, unsigned chan, DGE_Accum x, DGE_Accum y, DGE_Accum z);
+DGE_Native void DGE_SoundChanStop(unsigned src, unsigned chan);
+DGE_Native void DGE_SoundChanVolume(unsigned src, unsigned chan, DGE_ULFract volume);
+
+DGE_OptArgs(4)
+DGE_Native void DGE_SoundListener(DGE_Accum x, DGE_Accum y, DGE_Accum z, DGE_Accum velx, DGE_Accum vely, DGE_Accum velz, DGE_Accum angle);
+
+DGE_Native unsigned DGE_SoundSource(DGE_Accum x, DGE_Accum y, DGE_Accum z);
+DGE_OptArgs(1)
+DGE_Native unsigned DGE_SoundSrcBind(unsigned src, unsigned snd, unsigned chan);
+DGE_Native void DGE_SoundSrcDestroy(unsigned src);
+DGE_OptArgs(1)
+DGE_Native unsigned DGE_SoundSrcPlay(unsigned src, unsigned snd, unsigned chan);
+DGE_Native void DGE_SoundSrcPosition(unsigned src, DGE_Accum x, DGE_Accum y, DGE_Accum z);
+DGE_Native void DGE_SoundSrcVelocity(unsigned src, DGE_Accum x, DGE_Accum y, DGE_Accum z);
+
+DGE_Native DGE_String DGE_String_Create(char const *str, unsigned len);
+
+DGE_Native unsigned DGE_SysRead(char *buf, unsigned len);
+DGE_Native unsigned DGE_SysWrite(char const *buf, unsigned len);
+DGE_Native unsigned DGE_SysWriteErr(char const *buf, unsigned len);
+
+DGE_Native unsigned DGE_Task_Create(unsigned thread, DGE_CallbackType fn, ...);
+DGE_Native void DGE_Task_Sleep(unsigned id, unsigned ticks);
+
+DGE_Native unsigned DGE_Team_Create(unsigned ext);
+
+DGE_OptArgs(1)
+DGE_Native void DGE_TextAlignment(int h, int v);
+
+DGE_Native unsigned DGE_Thinker_Head(void);
+DGE_Native void DGE_Thinker_Insert(unsigned id);
+DGE_Native void DGE_Thinker_Unlink(unsigned id);
+
+
+//----------------------------------------------------------------------------|
+// Property Types                                                             |
+//
+
+//
+// DGE_Object
+//
+#define DGE_ObjectProps()
+typedef struct DGE_Object
+{
+   int id;
+
+   DGE_ObjectProps()
+} DGE_Object;
+
+//
+// DGE_Sector
+//
+#define DGE_SectorProps() DGE_ObjectProps() \
+   DGE_PropMem(DGE_LFract, frictair) \
+   DGE_PropMem(DGE_LFract, friction) \
+   DGE_PropMem(DGE_Accum,  gx) \
+   DGE_PropMem(DGE_Accum,  gy) \
+   DGE_PropMem(DGE_Accum,  gz) \
+   DGE_PropMem(unsigned,   pc) \
+   DGE_PropMem(unsigned,   texc) \
+   DGE_PropMem(unsigned,   texf) \
+   DGE_PropMem(DGE_Accum,  xh) \
+   DGE_PropMem(DGE_Accum,  xl) \
+   DGE_PropMem(DGE_Accum,  yh) \
+   DGE_PropMem(DGE_Accum,  yl) \
+   DGE_PropMem(DGE_Accum,  zh) \
+   DGE_PropMem(DGE_Accum,  zl)
+typedef struct DGE_Sector
+{
+   int id;
+
+   DGE_SectorProps()
+} DGE_Sector;
+
+//
+// DGE_Team
+//
+#define DGE_TeamProps() DGE_ObjectProps() \
+   DGE_PropMem(unsigned, entfi) \
+   DGE_PropMem(unsigned, entla) \
+   DGE_PropMem(unsigned, owner) \
+   DGE_PropMem(unsigned, teamfi) \
+   DGE_PropMem(unsigned, teamla) \
+   DGE_PropMem(unsigned, teamne) \
+   DGE_PropMem(unsigned, teampr)
+typedef struct DGE_Team
+{
+   int id;
+
+   DGE_TeamProps()
+} DGE_Team;
+
+//
+// DGE_Thinker
+//
+#define DGE_ThinkerProps() DGE_ObjectProps() \
+   DGE_PropMem(unsigned, next) \
+   DGE_PropMem(unsigned, prev)
+typedef struct DGE_Thinker
+{
+   int id;
+
+   DGE_ThinkerProps()
+} DGE_Thinker;
+
+//
+// DGE_PointThinker
+//
+#define DGE_PointThinkerProps() DGE_ThinkerProps() \
+   DGE_PropMem(DGE_ULFract, pitch) \
+   DGE_PropMem(DGE_Accum,   x) \
+   DGE_PropMem(DGE_Accum,   y) \
+   DGE_PropMem(DGE_ULFract, yaw) \
+   DGE_PropMem(DGE_Accum,   z)
+typedef struct DGE_PointThinker
+{
+   int id;
+
+   DGE_PointThinkerProps()
+} DGE_PointThinker;
+
+//
+// DGE_RenderThinker
+//
+#define DGE_RenderThinkerProps() DGE_PointThinkerProps() \
+   DGE_PropMem(DGE_Accum, rsx) \
+   DGE_PropMem(DGE_Accum, rsy) \
+   DGE_PropMem(unsigned,  sprite)
+typedef struct DGE_RenderThinker
+{
+   int id;
+
+   DGE_RenderThinkerProps()
+} DGE_RenderThinker;
+
+//
+// DGE_PhysicsThinker
+//
+#define DGE_PhysicsThinkerProps() DGE_RenderThinkerProps() \
+   DGE_PropMem(DGE_Accum,  bvx) \
+   DGE_PropMem(DGE_Accum,  bvy) \
+   DGE_PropMem(DGE_Accum,  bvz) \
+   DGE_PropMem(DGE_LFract, friction) \
+   DGE_PropMem(DGE_Accum,  grabx) \
+   DGE_PropMem(DGE_Accum,  graby) \
+   DGE_PropMem(DGE_Accum,  grabz) \
+   DGE_PropMem(DGE_Accum,  mass) \
+   DGE_PropMem(DGE_Accum,  sx) \
+   DGE_PropMem(DGE_Accum,  sy) \
+   DGE_PropMem(DGE_Accum,  sz) \
+   DGE_PropMem(DGE_Accum,  vx) \
+   DGE_PropMem(DGE_Accum,  vy) \
+   DGE_PropMem(DGE_Accum,  vz)
+typedef struct DGE_PhysicsThinker
+{
+   int id;
+
+   DGE_PhysicsThinkerProps()
+} DGE_PhysicsThinker;
+
+//
+// DGE_Entity
+//
+#define DGE_EntityProps() DGE_PhysicsThinkerProps() \
+   DGE_PropMem(int,      health) \
+   DGE_PropMem(unsigned, team) \
+   DGE_PropMem(unsigned, teamne) \
+   DGE_PropMem(unsigned, teampr)
+typedef struct DGE_Entity
+{
+   int id;
+
+   DGE_EntityProps()
+} DGE_Entity;
+
+//
+// DGE_MissileEntity
+//
+#define DGE_MissileEntityProps() DGE_EntityProps() \
+   DGE_PropMem(unsigned, damage) \
+   DGE_PropMem(unsigned, owner)
+typedef struct DGE_MissileEntity
+{
+   int id;
+
+   DGE_MissileEntityProps()
+} DGE_MissileEntity;
+
+#endif//__GDCC_Header__C__Doominati_h__
+

+ 241 - 0
bin_win/gdcc/lib/inc/C/GDCC/HashMap.h

@@ -0,0 +1,241 @@
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2017 David Hill
+//
+// See COPYLIB for license information.
+//
+//-----------------------------------------------------------------------------
+//
+// Header for target library libc.
+//
+// Generic HashMap generator.
+//
+//-----------------------------------------------------------------------------
+
+#ifndef __GDCC_Header__C__GDCC__HashMap_h__
+#define __GDCC_Header__C__GDCC__HashMap_h__
+
+
+//----------------------------------------------------------------------------|
+// Macros                                                                     |
+//
+
+//
+// GDCC_HashMap_Decl
+//
+// Required functions:
+//   Key    name##_GetKey (T *obj);
+//   T    **name##_GetNext(T *obj);
+//   T   ***name##_GetPrev(T *obj);
+//   size_t name##_HashKey(Key key);
+//   size_t name##_HashObj(T *obj);
+//   int    name##_KeyCmp (Key l, Key r);
+//
+// These may be implemented as macros, but must evaluate their arguments
+// exactly once.
+//
+#define GDCC_HashMap_Decl(name, Key, T) \
+   typedef struct name name; \
+   \
+   void   name##_ctor(name *map, size_t chainC, size_t growC); \
+   void   name##_dtor(name *map); \
+   \
+   void   name##_Clear (name *map); \
+   T     *name##_Find  (name *map, Key key); \
+   void   name##_Insert(name *map, T *obj); \
+   void   name##_Resize(name *map, size_t count); \
+   void   name##_Unlink(name *map, T *obj); \
+   \
+   GDCC_HashMap_DeclStruct(name, Key, T)
+
+//
+// GDCC_HashMap_DeclStruct
+//
+#if __GDCC__ // GDCC properties version.
+# define GDCC_HashMap_DeclStruct(name, Key, T) \
+   struct name \
+   { \
+      __prop clear  {call: name##_Clear(this)} \
+      __prop find   {call: name##_Find(this)} \
+      __prop insert {call: name##_Insert(this)} \
+      __prop resize {call: name##_Resize(this)} \
+      __prop unlink {call: name##_Unlink(this)} \
+      \
+      T    **chainV; \
+      size_t chainC; \
+      \
+      size_t objC; \
+      size_t growC; \
+   };
+#else // Generic C version.
+# define GDCC_HashMap_DeclStruct(name, Key, T) \
+   struct name \
+   { \
+      T    **chainV; \
+      size_t chainC; \
+      \
+      size_t objC; \
+      size_t growC; \
+   };
+#endif
+
+//
+// GDCC_HashMap_Defn
+//
+#define GDCC_HashMap_Defn(name, Key, T) \
+   GDCC_HashMap_Defn_ctor(name, Key, T) \
+   GDCC_HashMap_Defn_dtor(name, Key, T) \
+   \
+   GDCC_HashMap_Defn_Clear( name, Key, T) \
+   GDCC_HashMap_Defn_Find(  name, Key, T) \
+   GDCC_HashMap_Defn_Insert(name, Key, T) \
+   GDCC_HashMap_Defn_Resize(name, Key, T) \
+   GDCC_HashMap_Defn_Unlink(name, Key, T) \
+
+//
+// GDCC_HashMap_Defn_ctor
+//
+#define GDCC_HashMap_Defn_ctor(name, Key, T) \
+   void name##_ctor(name *map, size_t chainC, size_t growC) \
+   { \
+      map->chainV = malloc(sizeof(T *) * chainC); \
+      map->chainC = chainC; \
+      map->objC   = 0; \
+      map->growC  = growC; \
+      \
+      for(T **chain = map->chainV, **chainE = chain + chainC; chain != chainE; ++chain) \
+         *chain = NULL; \
+   }
+
+//
+// GDCC_HashMap_Defn_dtor
+//
+#define GDCC_HashMap_Defn_dtor(name, Key, T) \
+   void name##_dtor(name *map) \
+   { \
+      free(map->chainV); \
+   }
+
+//
+// GDCC_HashMap_Defn_Clear
+//
+#define GDCC_HashMap_Defn_Clear(name, Key, T) \
+   void name##_Clear(name *map) \
+   { \
+      for(T **chain = map->chainV, **chainE = chain + map->chainC; \
+         chain != chainE; ++chain) \
+      { \
+         while(*chain) \
+         { \
+            T  **next = name##_GetNext(*chain); \
+            T ***prev = name##_GetPrev(*chain); \
+            \
+            if((**prev = *next)) \
+               *name##_GetPrev(*next) = *prev; \
+            \
+            *next = NULL; \
+            *prev = NULL; \
+         } \
+      } \
+      \
+      map->objC = 0; \
+   }
+
+//
+// GDCC_HashMap_Defn_Find
+//
+#define GDCC_HashMap_Defn_Find(name, Key, T) \
+   T *name##_Find(name *map, Key key) \
+   { \
+      for(T *obj = map->chainV[name##_HashKey(key) % map->chainC]; obj; \
+         obj = *name##_GetNext(obj)) \
+      { \
+         if(!name##_KeyCmp(key, name##_GetKey(obj))) \
+            return obj; \
+      } \
+      \
+      return NULL; \
+   }
+
+//
+// GDCC_HashMap_Defn_Insert
+//
+#define GDCC_HashMap_Defn_Insert(name, Key, T) \
+   void name##_Insert(name *map, T *obj) \
+   { \
+      if(map->objC >= map->chainC) \
+         name##_Resize(map, map->chainC + map->chainC / 2 + map->growC); \
+      \
+      ++map->objC; \
+      \
+      T **head = &map->chainV[name##_HashObj(obj) % map->chainC]; \
+      T **next = name##_GetNext(obj); \
+      \
+      if((*next = *head)) \
+         *name##_GetPrev(*head) = next; \
+      *name##_GetPrev(obj) = head; \
+      *head = obj; \
+   }
+
+//
+// GDCC_HashMap_Defn_Resize
+//
+#define GDCC_HashMap_Defn_Resize(name, Key, T) \
+   void name##_Resize(name *map, size_t count) \
+   { \
+      \
+      T    **oldChainV = map->chainV; \
+      size_t oldChainC = map->chainC; \
+      \
+      map->chainV = malloc(sizeof(T *) * count); \
+      map->chainC = count; \
+      \
+      for(T **chain = map->chainV, **chainE = chain + count; chain != chainE; ++chain) \
+         *chain = NULL; \
+      \
+      /* Relink elements. */ \
+      for(T **chain = oldChainV, **chainE = chain + oldChainC; chain != chainE; ++chain) \
+      { \
+         while(*chain) \
+         { \
+            T   *obj  = *chain; \
+            T  **next = name##_GetNext(obj); \
+            T ***prev = name##_GetPrev(obj); \
+            \
+            /* Unlink from old chain. */ \
+            if((**prev = *next)) \
+               *name##_GetPrev(*next) = *prev; \
+            \
+            /* Insert into new chain. */ \
+            T **head = &map->chainV[name##_HashObj(obj) % map->chainC]; \
+            \
+            if((*next = *head)) \
+               *name##_GetPrev(*head) = next; \
+            *name##_GetPrev(obj) = head; \
+            *head = obj; \
+         } \
+      } \
+      \
+      free(oldChainV); \
+   }
+
+//
+// GDCC_HashMap_Defn_Unlink
+//
+#define GDCC_HashMap_Defn_Unlink(name, Key, T) \
+   void name##_Unlink(name *map, T *obj) \
+   { \
+      --map->objC; \
+      \
+      T  **next = name##_GetNext(obj); \
+      T ***prev = name##_GetPrev(obj); \
+      \
+      if((**prev = *next)) \
+         *name##_GetPrev(*next) = *prev; \
+      \
+      *next = NULL; \
+      *prev = NULL; \
+   }
+
+#endif//__GDCC_Header__C__GDCC__HashMap_h__
+

+ 2 - 0
bin_win/gdcc/lib/inc/C/bits/types.h

@@ -35,6 +35,7 @@ typedef unsigned long long __uintmax_t;
 typedef unsigned int __uintptr_t;
 typedef unsigned int __uptrdiff_t;
 typedef unsigned int __wchar_t;
+typedef int __wint_t;
 
 
 typedef __ssize_t __cookie_read_function_t(void *, char *, __size_t);
@@ -44,6 +45,7 @@ typedef int __cookie_close_function_t(void *);
 
 struct __FILE;
 struct __cookie_io_functions_t;
+struct __mbstate_t;
 
 #endif//__GDCC_Header__C__bits__types_h__
 

+ 55 - 11
bin_win/gdcc/lib/inc/C/inttypes.h

@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //
-// Copyright(C) 2014-2016 David Hill
+// Copyright(C) 2014-2017 David Hill
 //
 // See COPYLIB for license information.
 //
@@ -25,6 +25,10 @@
 //
 // PRId*
 //
+#if !__GDCC_Family__ZDACS__
+#define PRId8       "hhd"
+#define PRId16       "hd"
+#endif
 #define PRId32        "d"
 #define PRId64       "ld"
 #define PRId96      "lld"
@@ -47,6 +51,10 @@
 //
 // PRIi*
 //
+#if !__GDCC_Family__ZDACS__
+#define PRIi8       "hhi"
+#define PRIi16       "hi"
+#endif
 #define PRIi32        "i"
 #define PRIi64       "li"
 #define PRIi96      "lli"
@@ -69,6 +77,10 @@
 //
 // PRIo*
 //
+#if !__GDCC_Family__ZDACS__
+#define PRIo8       "hho"
+#define PRIo16       "ho"
+#endif
 #define PRIo32        "o"
 #define PRIo64       "lo"
 #define PRIo96      "llo"
@@ -91,6 +103,10 @@
 //
 // PRIu*
 //
+#if !__GDCC_Family__ZDACS__
+#define PRIu8       "hhu"
+#define PRIu16       "hu"
+#endif
 #define PRIu32        "u"
 #define PRIu64       "lu"
 #define PRIu96      "llu"
@@ -113,6 +129,10 @@
 //
 // PRIx*
 //
+#if !__GDCC_Family__ZDACS__
+#define PRIx8       "hhx"
+#define PRIx16       "hx"
+#endif
 #define PRIx32        "x"
 #define PRIx64       "lx"
 #define PRIx96      "llx"
@@ -135,6 +155,10 @@
 //
 // PRIX*
 //
+#if !__GDCC_Family__ZDACS__
+#define PRIX8       "hhX"
+#define PRIX16       "hX"
+#endif
 #define PRIX32        "X"
 #define PRIX64       "lX"
 #define PRIX96      "llX"
@@ -157,12 +181,16 @@
 //
 // SCNd*
 //
+#if !__GDCC_Family__ZDACS__
+#define SCNd8       "hhd"
+#define SCNd16       "hd"
+#endif
 #define SCNd32        "d"
 #define SCNd64       "ld"
 #define SCNd96      "lld"
 
-#define SCNdLEAST8    "d"
-#define SCNdLEAST16   "d"
+#define SCNdLEAST8  "hhd"
+#define SCNdLEAST16  "hd"
 #define SCNdLEAST32   "d"
 #define SCNdLEAST64  "ld"
 #define SCNdLEAST96 "lld"
@@ -179,12 +207,16 @@
 //
 // SCNi*
 //
+#if !__GDCC_Family__ZDACS__
+#define SCNi8       "hhi"
+#define SCNi16       "hi"
+#endif
 #define SCNi32        "i"
 #define SCNi64       "li"
 #define SCNi96      "lli"
 
-#define SCNiLEAST8    "i"
-#define SCNiLEAST16   "i"
+#define SCNiLEAST8  "hhi"
+#define SCNiLEAST16  "hi"
 #define SCNiLEAST32   "i"
 #define SCNiLEAST64  "li"
 #define SCNiLEAST96 "lli"
@@ -201,12 +233,16 @@
 //
 // SCNo*
 //
+#if !__GDCC_Family__ZDACS__
+#define SCNo8       "hho"
+#define SCNo16       "ho"
+#endif
 #define SCNo32        "o"
 #define SCNo64       "lo"
 #define SCNo96      "llo"
 
-#define SCNoLEAST8    "o"
-#define SCNoLEAST16   "o"
+#define SCNoLEAST8  "hho"
+#define SCNoLEAST16  "ho"
 #define SCNoLEAST32   "o"
 #define SCNoLEAST64  "lo"
 #define SCNoLEAST96 "llo"
@@ -223,12 +259,16 @@
 //
 // SCNu*
 //
+#if !__GDCC_Family__ZDACS__
+#define SCNu8       "hhu"
+#define SCNu16       "hu"
+#endif
 #define SCNu32        "u"
 #define SCNu64       "lu"
 #define SCNu96      "llu"
 
-#define SCNuLEAST8    "u"
-#define SCNuLEAST16   "u"
+#define SCNuLEAST8  "hhu"
+#define SCNuLEAST16  "hu"
 #define SCNuLEAST32   "u"
 #define SCNuLEAST64  "lu"
 #define SCNuLEAST96 "llu"
@@ -245,12 +285,16 @@
 //
 // SCNx*
 //
+#if !__GDCC_Family__ZDACS__
+#define SCNx8       "hhx"
+#define SCNx16       "hx"
+#endif
 #define SCNx32        "x"
 #define SCNx64       "lx"
 #define SCNx96      "llx"
 
-#define SCNxLEAST8    "x"
-#define SCNxLEAST16   "x"
+#define SCNxLEAST8  "hhx"
+#define SCNxLEAST16  "hx"
 #define SCNxLEAST32   "x"
 #define SCNxLEAST64  "lx"
 #define SCNxLEAST96 "llx"

+ 52 - 10
bin_win/gdcc/lib/inc/C/limits.h

@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //
-// Copyright(C) 2014-2016 David Hill
+// Copyright(C) 2014-2017 David Hill
 //
 // See COPYLIB for license information.
 //
@@ -22,29 +22,71 @@
 // Macros                                                                     |
 //
 
+//
+// CHAR_BIT
+//
+#if __GDCC_Family__ZDACS__
 #define CHAR_BIT 32
+#else
+#define CHAR_BIT 8
+#endif
 
-#define SCHAR_MIN (-0x7FFFFFFF-1)
-#define SCHAR_MAX ( 0x7FFFFFFF  )
-#define UCHAR_MAX ( 0xFFFFFFFFU )
+//
+// CHAR_*
+//
+#if __GDCC_Family__ZDACS__
+# define SCHAR_MIN (-0x7FFFFFFF-1)
+# define SCHAR_MAX ( 0x7FFFFFFF  )
+# define UCHAR_MAX ( 0xFFFFFFFFU )
+#else
+# define SCHAR_MIN (-0x7F-1)
+# define SCHAR_MAX ( 0x7F  )
+# define UCHAR_MAX ( 0xFFU )
+#endif
 
-#define CHAR_MIN SCHAR_MIN
-#define CHAR_MAX SCHAR_MAX
+#if __GDCC_Family__ZDACS__
+# define CHAR_MIN SCHAR_MIN
+# define CHAR_MAX SCHAR_MAX
+#else
+# define CHAR_MIN UCHAR_MIN
+# define CHAR_MAX UCHAR_MAX
+#endif
 
-#define MB_LEN_MAX 1
+//
+// MB_LEN_MAX
+//
+#define MB_LEN_MAX 6
 
-#define  SHRT_MIN (-0x7FFFFFFF-1)
-#define  SHRT_MAX ( 0x7FFFFFFF  )
-#define USHRT_MAX ( 0xFFFFFFFFU )
+//
+// SHRT_*
+//
+#if __GDCC_Family__ZDACS__
+# define  SHRT_MIN (-0x7FFFFFFF-1)
+# define  SHRT_MAX ( 0x7FFFFFFF  )
+# define USHRT_MAX ( 0xFFFFFFFFU )
+#else
+# define  SHRT_MIN (-0x7FFF-1)
+# define  SHRT_MAX ( 0x7FFF  )
+# define USHRT_MAX ( 0xFFFFU )
+#endif
 
+//
+// INT_*
+//
 #define  INT_MIN (-0x7FFFFFFF-1)
 #define  INT_MAX ( 0x7FFFFFFF  )
 #define UINT_MAX ( 0xFFFFFFFFU )
 
+//
+// LONG_*
+//
 #define  LONG_MIN (-0x7FFFFFFFFFFFFFFFL-1)
 #define  LONG_MAX ( 0x7FFFFFFFFFFFFFFFL  )
 #define ULONG_MAX ( 0xFFFFFFFFFFFFFFFFUL )
 
+//
+// LLONG_*
+//
 #define  LLONG_MIN (-0x7FFFFFFFFFFFFFFFFFFFFFFFLL-1)
 #define  LLONG_MAX ( 0x7FFFFFFFFFFFFFFFFFFFFFFFLL  )
 #define ULLONG_MAX ( 0xFFFFFFFFFFFFFFFFFFFFFFFFULL )

+ 5 - 1
bin_win/gdcc/lib/inc/C/setjmp.h

@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //
-// Copyright(C) 2015-2016 David Hill
+// Copyright(C) 2015-2017 David Hill
 //
 // See COPYLIB for license information.
 //
@@ -35,7 +35,11 @@
 //
 // jmpbuf
 //
+#if !__GDCC_Family__ZDACS__
+typedef int jmp_buf[4];
+#else
 typedef int jmp_buf[3];
+#endif
 
 
 //----------------------------------------------------------------------------|

+ 73 - 28
bin_win/gdcc/lib/inc/C/stdfix.h

@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //
-// Copyright(C) 2015-2016 David Hill
+// Copyright(C) 2015-2017 David Hill
 //
 // See COPYLIB for license information.
 //
@@ -91,53 +91,98 @@
 //
 // SACCUM_*
 //
-#define SACCUM_FBIT 16
-#define SACCUM_IBIT 15
-#define SACCUM_MIN (-0x4000p-0HK-0x4000p-0HK)
-#define SACCUM_MAX 0x7FFF.FFFFp-0HK
-#define SACCUM_EPSILON 0x1p-16HK
+#if __GDCC_Target__Doominati__
+# define SACCUM_FBIT 7
+# define SACCUM_IBIT 24
+# define SACCUM_MIN (-0x800000p-0HK-0x800000p-0HK)
+# define SACCUM_MAX 0xFFFFFF.FEp-0HK
+# define SACCUM_EPSILON 0x1p-7HK
+#else
+# define SACCUM_FBIT 16
+# define SACCUM_IBIT 15
+# define SACCUM_MIN (-0x4000p-0HK-0x4000p-0HK)
+# define SACCUM_MAX 0x7FFF.FFFFp-0HK
+# define SACCUM_EPSILON 0x1p-16HK
+#endif
 
 //
 // USACCUM_*
 //
-#define USACCUM_FBIT 16
-#define USACCUM_IBIT 16
-#define USACCUM_MAX 0xFFFF.FFFFp-0UHK
-#define USACCUM_EPSILON 0x1p-16UHK
+#if __GDCC_Target__Doominati__
+# define USACCUM_FBIT 7
+# define USACCUM_IBIT 25
+# define USACCUM_MAX 0x1FFFFFF.FEp-0UHK
+# define USACCUM_EPSILON 0x1p-7UHK
+#else
+# define USACCUM_FBIT 16
+# define USACCUM_IBIT 16
+# define USACCUM_MAX 0xFFFF.FFFFp-0UHK
+# define USACCUM_EPSILON 0x1p-16UHK
+#endif
 
 //
 // ACCUM_*
 //
-#define ACCUM_FBIT 16
-#define ACCUM_IBIT 15
-#define ACCUM_MIN (-0x4000p-0K-0x4000p-0K)
-#define ACCUM_MAX 0x7FFF.FFFFp-0K
-#define ACCUM_EPSILON 0x1p-16K
+#if __GDCC_Target__Doominati__
+# define ACCUM_FBIT 15
+# define ACCUM_IBIT 48
+# define ACCUM_MIN (-0x800000000000p-0K-0x800000000000p-0K)
+# define ACCUM_MAX 0xFFFFFFFFFFFF.FFFEp-0K
+# define ACCUM_EPSILON 0x1p-15K
+#else
+# define ACCUM_FBIT 16
+# define ACCUM_IBIT 15
+# define ACCUM_MIN (-0x4000p-0K-0x4000p-0K)
+# define ACCUM_MAX 0x7FFF.FFFFp-0K
+# define ACCUM_EPSILON 0x1p-16K
+#endif
 
 //
 // UACCUM_*
 //
-#define UACCUM_FBIT 16
-#define UACCUM_IBIT 16
-#define UACCUM_MAX 0xFFFF.FFFFp-0UK
-#define UACCUM_EPSILON 0x1p-16UK
+#if __GDCC_Target__Doominati__
+# define UACCUM_FBIT 15
+# define UACCUM_IBIT 49
+# define UACCUM_MAX 0x1FFFFFFFFFFFF.FFFEp-0K
+# define UACCUM_EPSILON 0x1p-15UK
+#else
+# define UACCUM_FBIT 16
+# define UACCUM_IBIT 16
+# define UACCUM_MAX 0xFFFF.FFFFp-0UK
+# define UACCUM_EPSILON 0x1p-16UK
+#endif
 
 //
 // LACCUM_*
 //
-#define LACCUM_FBIT 32
-#define LACCUM_IBIT 31
-#define LACCUM_MIN (-0x40000000p-0LK-0x40000000p-0LK)
-#define LACCUM_MAX 0x7FFFFFFF.FFFFFFFFp-0LK
-#define LACCUM_EPSILON 0x1p-32LK
+#if __GDCC_Target__Doominati__
+# define LACCUM_FBIT 32
+# define LACCUM_IBIT 63
+# define LACCUM_MIN (-0x4000000000000000p-0LK-0x4000000000000000p-0LK)
+# define LACCUM_MAX 0x7FFFFFFFFFFFFFFF.FFFFFFFFp-0LK
+# define LACCUM_EPSILON 0x1p-32LK
+#else
+# define LACCUM_FBIT 32
+# define LACCUM_IBIT 31
+# define LACCUM_MIN (-0x40000000p-0LK-0x40000000p-0LK)
+# define LACCUM_MAX 0x7FFFFFFF.FFFFFFFFp-0LK
+# define LACCUM_EPSILON 0x1p-32LK
+#endif
 
 //
 // ULACCUM_*
 //
-#define ULACCUM_FBIT 32
-#define ULACCUM_IBIT 32
-#define ULACCUM_MAX 0xFFFFFFFF.FFFFFFFFp-0ULK
-#define ULACCUM_EPSILON 0x1p-32ULK
+#if __GDCC_Target__Doominati__
+# define ULACCUM_FBIT 32
+# define ULACCUM_IBIT 64
+# define ULACCUM_MAX 0xFFFFFFFFFFFFFFFF.FFFFFFFFp-0ULK
+# define ULACCUM_EPSILON 0x1p-32ULK
+#else
+# define ULACCUM_FBIT 32
+# define ULACCUM_IBIT 32
+# define ULACCUM_MAX 0xFFFFFFFF.FFFFFFFFp-0ULK
+# define ULACCUM_EPSILON 0x1p-32ULK
+#endif
 
 //
 // absfx

+ 37 - 5
bin_win/gdcc/lib/inc/C/stdint.h

@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //
-// Copyright(C) 2014-2016 David Hill
+// Copyright(C) 2014-2017 David Hill
 //
 // See COPYLIB for license information.
 //
@@ -22,6 +22,18 @@
 // Macros                                                                     |
 //
 
+#if !__GDCC_Family__ZDACS__
+#define  INT8_MIN (-0x7F-1)
+#define  INT8_MAX ( 0x7F  )
+#define UINT8_MAX ( 0xFFU )
+#endif
+
+#if !__GDCC_Family__ZDACS__
+#define  INT16_MIN (-0x7FFF-1)
+#define  INT16_MAX ( 0x7FFF  )
+#define UINT16_MAX ( 0xFFFFU )
+#endif
+
 #define  INT32_MIN (-0x7FFFFFFF-1)
 #define  INT32_MAX ( 0x7FFFFFFF  )
 #define UINT32_MAX ( 0xFFFFFFFFU )
@@ -34,13 +46,25 @@
 #define  INT96_MAX ( 0x7FFFFFFFFFFFFFFFFFFFFFFF  )
 #define UINT96_MAX ( 0xFFFFFFFFFFFFFFFFFFFFFFFFU )
 
+#if __GDCC_Family__ZDACS__
 #define  INT_LEAST8_MIN (-0x7FFFFFFF-1)
 #define  INT_LEAST8_MAX ( 0x7FFFFFFF  )
 #define UINT_LEAST8_MAX ( 0xFFFFFFFFU )
+#else
+#define  INT_LEAST8_MIN (-0x7F-1)
+#define  INT_LEAST8_MAX ( 0x7F  )
+#define UINT_LEAST8_MAX ( 0xFFU )
+#endif
 
+#if __GDCC_Family__ZDACS__
 #define  INT_LEAST16_MIN (-0x7FFFFFFF-1)
 #define  INT_LEAST16_MAX ( 0x7FFFFFFF  )
 #define UINT_LEAST16_MAX ( 0xFFFFFFFFU )
+#else
+#define  INT_LEAST16_MIN (-0x7FFF-1)
+#define  INT_LEAST16_MAX ( 0x7FFF  )
+#define UINT_LEAST16_MAX ( 0xFFFFU )
+#endif
 
 #define  INT_LEAST32_MIN (-0x7FFFFFFF-1)
 #define  INT_LEAST32_MAX ( 0x7FFFFFFF  )
@@ -129,6 +153,10 @@
 //
 // intN_t
 //
+#if !__GDCC_Family__ZDACS__
+typedef signed          char int8_t;
+typedef signed     short int int16_t;
+#endif
 typedef signed           int int32_t;
 typedef signed      long int int64_t;
 typedef signed long long int int96_t;
@@ -136,6 +164,10 @@ typedef signed long long int int96_t;
 //
 // uintN_t
 //
+#if !__GDCC_Family__ZDACS__
+typedef unsigned          char uint8_t;
+typedef unsigned     short int uint16_t;
+#endif
 typedef unsigned           int uint32_t;
 typedef unsigned      long int uint64_t;
 typedef unsigned long long int uint96_t;
@@ -143,8 +175,8 @@ typedef unsigned long long int uint96_t;
 //
 // int_leastN_t
 //
-typedef signed           int int_least8_t;
-typedef signed           int int_least16_t;
+typedef signed          char int_least8_t;
+typedef signed     short int int_least16_t;
 typedef signed           int int_least32_t;
 typedef signed      long int int_least64_t;
 typedef signed long long int int_least96_t;
@@ -152,8 +184,8 @@ typedef signed long long int int_least96_t;
 //
 // uint_leastN_t
 //
-typedef unsigned           int uint_least8_t;
-typedef unsigned           int uint_least16_t;
+typedef unsigned          char uint_least8_t;
+typedef unsigned     short int uint_least16_t;
 typedef unsigned           int uint_least32_t;
 typedef unsigned      long int uint_least64_t;
 typedef unsigned long long int uint_least96_t;

+ 4 - 4
bin_win/gdcc/lib/inc/C/stdlib.h

@@ -35,7 +35,7 @@
 //
 // MB_CUR_MAX
 //
-#define MB_CUR_MAX ((size_t)1)
+#define MB_CUR_MAX ((size_t)6)
 
 //
 // NULL
@@ -87,7 +87,7 @@ typedef __wchar_t wchar_t;
 
 
 //----------------------------------------------------------------------------|
-// Global Functions                                                           |
+// Extern Functions                                                           |
 //
 
 #ifdef __cplusplus
@@ -108,10 +108,8 @@ double strtod(char const *restrict _nptr, char **restrict _endptr);
 float strtof(char const *restrict _nptr, char **restrict _endptr);
 long double strtold(char const *restrict _nptr, char **restrict _endptr);
 
-int strtoi(char const *restrict _nptr, char **restrict _endptr, int _base);
 long strtol(char const *restrict _nptr, char **restrict _endptr, int _base);
 long long strtoll(char const *restrict _nptr, char **restrict _endptr, int _base);
-unsigned int strtoui(char const *restrict _nptr, char **restrict _endptr, int _base);
 unsigned long strtoul(char const *restrict _nptr, char **restrict _endptr, int _base);
 unsigned long long strtoull(char const *restrict _nptr, char **restrict _endptr, int _base);
 
@@ -187,9 +185,11 @@ double strtod_str(char __str_ars const *restrict _nptr, char __str_ars **restric
 float strtof_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
 long double strtold_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr);
 
+int strtoi(char const *restrict _nptr, char **restrict _endptr, int _base);
 int strtoi_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
 long strtol_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
 long long strtoll_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
+unsigned int strtoui(char const *restrict _nptr, char **restrict _endptr, int _base);
 unsigned int strtoui_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
 unsigned long strtoul_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);
 unsigned long long strtoull_str(char __str_ars const *restrict _nptr, char __str_ars **restrict _endptr, int _base);

+ 13 - 0
bin_win/gdcc/lib/inc/C/string.h

@@ -99,10 +99,23 @@ char *strerror(int _errnum);
 size_t strlen(char const *_s);
 
 //
+// GNU extensions.
+//
+
+#if defined(_GNU_SOURCE)
+char *strcasestr(char const *_s1, char const *_s2);
+#endif
+
+//
 // Implementation extensions.
 //
 
+char *strcasechr(char const *_s, int _c);
+char __str_ars *strcasechr_str(char __str_ars const *_s, int _c);
+char __str_ars *strcasestr_str(char __str_ars const *_s1, char __str_ars const *_s2);
+char __str_ars *strchr_str(char __str_ars const *_s, int _c);
 size_t strlen_str(char __str_ars const *_s);
+char __str_ars *strstr_str(char __str_ars const *_s1, char __str_ars const *_s2);
 
 #ifdef __cplusplus
 };

+ 240 - 0
bin_win/gdcc/lib/inc/C/wchar.h

@@ -0,0 +1,240 @@
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 2016 David Hill
+//
+// See COPYLIB for license information.
+//
+//-----------------------------------------------------------------------------
+//
+// Header for target library libc.
+//
+// Extended multibyte and wide character utilities.
+//
+//-----------------------------------------------------------------------------
+
+#ifndef __GDCC_Header__C__wchar_h__
+#define __GDCC_Header__C__wchar_h__
+
+#include <bits/types.h>
+
+
+//----------------------------------------------------------------------------|
+// Macros                                                                     |
+//
+
+//
+// NULL
+//
+#ifndef NULL
+#define NULL 0
+#endif
+
+//
+// WCHAR_MIN
+//
+#ifndef WCHAR_MIN
+#define WCHAR_MIN 0
+#endif
+
+//
+// WCHAR_MAX
+//
+#ifndef WCHAR_MAX
+#define WCHAR_MAX 0xFFFFFFFF
+#endif
+
+//
+// WEOF
+//
+#ifndef WEOF
+#define WEOF (-1)
+#endif
+
+
+//----------------------------------------------------------------------------|
+// Types                                                                      |
+//
+
+struct tm;
+
+//
+// wchar_t
+//
+#ifndef __GDCC_Have__wchar_t__
+#define __GDCC_Have__wchar_t__
+typedef __wchar_t wchar_t;
+#endif
+
+//
+// size_t
+//
+#ifndef __GDCC_Have__size_t__
+#define __GDCC_Have__size_t__
+typedef __size_t size_t;
+#endif
+
+//
+// mbstate_t
+//
+#ifndef __GDCC_Have__mbstate_t__
+#define __GDCC_Have__mbstate_t__
+typedef struct __mbstate_t {int;} mbstate_t;
+#endif
+
+//
+// wint_t
+//
+#ifndef __GDCC_Have__wint_t__
+#define __GDCC_Have__wint_t__
+typedef __wint_t wint_t;
+#endif
+
+struct tm;
+
+
+//----------------------------------------------------------------------------|
+// Extern Functions                                                           |
+//
+
+//
+// Formatted wide character input/output functions.
+//
+
+int fwprintf(struct __FILE *restrict _stream, wchar_t const *restrict _format, ...);
+int fwscanf(struct __FILE *restrict _stream, wchar_t const *restrict _format, ...);
+int swprintf(wchar_t *restrict _s, size_t _n, wchar_t const *restrict _format, ...);
+int swscanf(wchar_t const *restrict _s, wchar_t const *restrict _format, ...);
+int vfwprintf(struct __FILE *restrict _stream, wchar_t const *restrict _format, __va_list _arg);
+int vfwscanf(struct __FILE *restrict _stream, wchar_t const *restrict _format, __va_list _arg);
+int vswprintf(wchar_t *restrict _s, size_t _n, wchar_t const *restrict _format, __va_list _arg);
+int vswscanf(wchar_t const *restrict _s, wchar_t const *restrict _format, __va_list _arg);
+int vwprintf(wchar_t const *restrict _format, __va_list _arg);
+int vwscanf(wchar_t const *restrict _format, __va_list _arg);
+int wprintf(wchar_t const *restrict _format, ...);
+int wscanf(wchar_t const *restrict _format, ...);
+
+//
+// Wide character input/output functions.
+//
+
+wint_t fgetwc(struct __FILE *_stream);
+wchar_t *fgetws(wchar_t *restrict _s, int _n, struct __FILE *restrict _stream);
+wint_t fputwc(wchar_t _c, struct __FILE *_stream);
+int fputws(wchar_t const *restrict _s, struct __FILE *restrict _stream);
+int fwide(struct __FILE *_stream, int _mode);
+wint_t getwc(struct __FILE *_stream);
+wint_t getwchar(void);
+wint_t putwc(wchar_t _c, struct __FILE *_stream);
+wint_t putwchar(wchar_t _c);
+wint_t ungetwc(wint_t _c, struct __FILE *_stream);
+
+//
+// General wide string utilities.
+//
+
+//
+// Wide string numeric conversion functions.
+//
+
+double wcstod(wchar_t const *restrict _nptr, wchar_t **restrict _endptr);
+float wcstof(wchar_t const *restrict _nptr, wchar_t **restrict _endptr);
+long double wcstold(wchar_t const *restrict _nptr, wchar_t **restrict _endptr);
+
+int wcstoi(wchar_t const *restrict _nptr, wchar_t **restrict _endptr, int _base);
+long wcstol(wchar_t const *restrict _nptr, wchar_t **restrict _endptr, int _base);
+long long wcstoll(wchar_t const *restrict _nptr, wchar_t **restrict _endptr, int _base);
+unsigned int wcstoui(wchar_t const * restrict _nptr, wchar_t **restrict _endptr, int _base);
+unsigned long wcstoul(wchar_t const * restrict _nptr, wchar_t **restrict _endptr, int _base);
+unsigned long long wcstoull(wchar_t const *restrict _nptr, wchar_t **restrict _endptr, int _base);
+
+//
+// Wide string copying functions.
+//
+
+wchar_t *wcscpy(wchar_t *restrict _s1, wchar_t const *restrict _s2);
+wchar_t *wcsncpy(wchar_t *restrict _s1, wchar_t const *restrict _s2, size_t _n);
+
+wchar_t *wmemcpy(wchar_t *restrict _s1, wchar_t const *restrict _s2, size_t _n);
+wchar_t *wmemmove(wchar_t *_s1, wchar_t const *_s2, size_t _n);
+
+//
+// Wide string concatenation functions.
+//
+
+wchar_t *wcscat(wchar_t *restrict _s1, wchar_t const *restrict _s2);
+wchar_t *wcsncat(wchar_t *restrict _s1, wchar_t const *restrict _s2, size_t _n);
+
+//
+// Wide string comparison functions.
+//
+
+int wcscmp(wchar_t const *_s1, wchar_t const *_s2);
+int wcscoll(wchar_t const *_s1, wchar_t const *_s2);
+int wcsncmp(wchar_t const *_s1, wchar_t const *_s2, size_t _n);
+int wcsncmp(wchar_t const *_s1, wchar_t const *_s2, size_t _n);
+int wmemcmp(wchar_t const *_s1, wchar_t const *_s2, size_t _n);
+
+//
+// Wide string search functions.
+//
+
+wchar_t *wcschr(wchar_t const *_s, wchar_t _c);
+size_t wcscspn(wchar_t const *_s1, wchar_t const *_s2);
+wchar_t *wcspbrk(wchar_t const *_s1, wchar_t const *_s2);
+wchar_t *wcsrchr(wchar_t const *_s, wchar_t _c);
+size_t wcsspn(wchar_t const *_s1, wchar_t const *_s2);
+wchar_t *wcsstr(wchar_t const *_s1, wchar_t const *_s2);
+wchar_t *wcstok(wchar_t *restrict _s1, wchar_t const *restrict _s2, wchar_t **restrict _ptr);
+wchar_t *wmemchr(wchar_t const *_s, wchar_t _c, size_t _n);
+
+//
+// Miscellaneous functions.
+//
+
+size_t wcslen(wchar_t const *_s);
+wchar_t *wmemset(wchar_t *_s, wchar_t _c, size_t _n);
+
+//
+// Wide character time conversion functions.
+//
+
+size_t wcsftime(wchar_t *restrict _s, size_t _maxsize,
+   wchar_t const *restrict _format, struct tm const *restrict _timeptr);
+
+//
+// Extended multibyte/wide character conversion utilities.
+//
+
+//
+// Single-byte/wide character conversion functions.
+//
+
+wint_t btowc(int _c);
+int wctob(wint_t _c);
+
+//
+// Conversion state functions.
+//
+
+int mbsinit(const mbstate_t *_ps);
+
+//
+// Restartable multibyte/wide character conversion functions.
+//
+
+size_t mbrlen(char const *restrict _s, size_t _n, mbstate_t *restrict _ps);
+size_t mbrtowc(wchar_t *restrict _pwc, char const *restrict _s, size_t _n,
+   mbstate_t *restrict _ps);
+size_t wcrtomb(char *restrict _s, wchar_t _wc, mbstate_t *restrict _ps);
+
+//
+// Restartable multibyte/wide string conversion functions.
+//
+
+size_t mbsrtowcs(wchar_t *restrict _dst, char const **restrict _src, size_t _len,
+   mbstate_t *restrict _ps);
+size_t wcsrtombs(char *restrict _dst, wchar_t const **restrict _src, size_t _len,
+   mbstate_t *restrict _ps);
+
+#endif//__GDCC_Header__C__wchar_h__
+

+ 29 - 8
bin_win/gdcc/lib/src/libGDCC/alloc.c

@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //
-// Copyright(C) 2014-2016 David Hill
+// Copyright(C) 2014-2017 David Hill
 //
 // See COPYLIB for license information.
 //
@@ -16,12 +16,25 @@
 #include <ACS_ZDoom.h>
 #endif
 
+#if __GDCC_Target__Doominati__
+#include <Doominati.h>
+#endif
+
 
 //----------------------------------------------------------------------------|
 // Macros                                                                     |
 //
 
 //
+// __GDCC__AllocAlign
+//
+// Controls the minimum alignment requirement of allocations.
+//
+#ifndef __GDCC__AllocAlign
+#define __GDCC__AllocAlign (_Alignof(MemBlock))
+#endif
+
+//
 // __GDCC__AllocSize
 //
 // Controls the total size of the allocation heap, in bytes.
@@ -86,11 +99,12 @@ struct MemBlock
 // Static Variables                                                           |
 //
 
+#if __GDCC_Family__ZDACS__
 //_Alignas(MemBlock)
 [[no_init]]
 static char AllocHeapRaw[__GDCC__AllocSize];
+#endif
 
-[[no_init]]
 static MemBlockPtr AllocBase, AllocIter;
 
 #if __GDCC_Family__ZDACS__
@@ -187,10 +201,18 @@ static void AllocDelAuto(void)
 [[call("StkCall")]]
 static void AllocInit(void)
 {
+   __size_t allocSize;
+
+   #if __GDCC_Family__ZDACS__
+   allocSize = __GDCC__AllocSize;
    AllocBase = AllocIter = (MemBlockPtr)AllocHeapRaw;
+   #elif __GDCC_Target__Doominati__
+   allocSize = (char *)DGE_FreestoreEnd() - (char *)DGE_FreestoreBegin();
+   AllocBase = AllocIter = (MemBlockPtr)DGE_FreestoreBegin();
+   #endif
 
    AllocBase->next = AllocBase->prev = AllocBase;
-   AllocBase->size = __GDCC__AllocSize - sizeof(MemBlock);
+   AllocBase->size = allocSize - sizeof(MemBlock);
    AllocBase->flag = 0;
 }
 
@@ -251,7 +273,8 @@ static _Bool AllocMerge(register MemBlockPtr block, register __size_t size)
 [[call("StkCall")]]
 static VoidPtr AllocNew(register __size_t size)
 {
-   // TODO: Round size up to alignment of MemBlock.
+   // Round size up to alignment of MemBlock.
+   size = (size + (__GDCC__AllocAlign - 1)) & ~(__GDCC__AllocAlign - 1);
 
    register MemBlockPtr iter = AllocIter;
 
@@ -406,14 +429,15 @@ void __GDCC__alloc_dump(void)
 //
 // __GDCC__Plsa
 //
-#if __GDCC_Family__ZDACS__
 [[call("StkCall")]]
 VoidPtr __GDCC__Plsa(unsigned int size)
 {
+   #if __GDCC_Family__ZDACS__
    // Check if a new hub was entered. If so, free automatic storage.
    if(AllocTime > ACS_Timer())
       AllocDelAuto();
    AllocTime = ACS_Timer();
+   #endif
 
    MemBlockPtr block = PtrToBlock(__GDCC__alloc(0, size));
 
@@ -421,18 +445,15 @@ VoidPtr __GDCC__Plsa(unsigned int size)
 
    return block->data;
 }
-#endif
 
 //
 // __GDCC__Plsf
 //
-#if __GDCC_Family__ZDACS__
 [[call("StkCall")]]
 void __GDCC__Plsf(VoidPtr ptr)
 {
    AllocDel(PtrToBlock(ptr));
 }
-#endif
 
 // EOF
 

+ 21 - 0
bin_win/gdcc/lib/src/libc/DGE/defs.asm

@@ -0,0 +1,21 @@
+;;-----------------------------------------------------------------------------
+;;
+;; Copyright(C) 2017 David Hill
+;;
+;; See COPYLIB for license information.
+;;
+;;-----------------------------------------------------------------------------
+;;
+;; DGE definitions
+;;
+;;-----------------------------------------------------------------------------
+
+
+;;----------------------------------------------------------------------------|
+;; Glyphs                                                                     |
+;;
+
+Glyph "___MathRegSize" type=Fixed(32, 0, 0, 0) value=4
+
+;; EOF
+

+ 21 - 0
bin_win/gdcc/lib/src/libc/ZDACS/defs.asm

@@ -0,0 +1,21 @@
+;;-----------------------------------------------------------------------------
+;;
+;; Copyright(C) 2017 David Hill
+;;
+;; See COPYLIB for license information.
+;;
+;;-----------------------------------------------------------------------------
+;;
+;; ZDACS definitions
+;;
+;;-----------------------------------------------------------------------------
+
+
+;;----------------------------------------------------------------------------|
+;; Glyphs                                                                     |
+;;
+
+Glyph "___MathRegSize" type=Fixed(32, 0, 0, 0) value=1
+
+;; EOF
+

+ 108 - 108
bin_win/gdcc/lib/src/libc/ZDACS/approx.asm