Permalink
Browse files

Merged new runtime. Added templated absolute value and fixed a couple…

… of runtime bugs.
  • Loading branch information...
wilkie committed May 18, 2010
2 parents 0395130 + cb754a5 commit ead8c19d773804e62a11be1b5156f31f4a530d01
Showing with 2,462 additions and 1,241 deletions.
  1. +9 −8 Makefile
  2. +5 −0 analyzing/debugger.d
  3. +178 −13 binding/c.d
  4. +3 −3 binding/cairo/cairo.d
  5. +3 −3 binding/ncurses/ncurses.d
  6. +10 −9 binding/x/X.d
  7. +105 −105 binding/x/Xlib.d
  8. +29 −0 compiler/ldc/cstdarg.d
  9. +24 −0 compiler/ldc/vararg.d
  10. +39 −158 core/color.d
  11. +103 −144 core/definitions.d
  12. +13 −1 core/error.d
  13. +2 −2 core/event.d
  14. +7 −9 core/exception.d
  15. +0 −52 core/main.d
  16. +0 −17 core/parameters.d
  17. +2 −0 core/string.d
  18. +2 −0 cui/application.d
  19. +1 −9 cui/container.d
  20. +1 −1 data/iterable.d
  21. +2 −0 data/list.d
  22. +1 −1 data/queue.d
  23. +2 −1 djehuty.d
  24. +6 −4 examples/CuiTetris/app.d
  25. +14 −15 examples/CuiTetris/gamecontrol.d
  26. +6 −1 examples/MoreDucks/MoreDucks.d
  27. +6 −4 examples/Snake/app.d
  28. +10 −5 examples/Snake/constants.d
  29. +2 −2 examples/Snake/game.d
  30. +1 −0 examples/Snake/snake.d
  31. +4 −3 examples/Snake/win.d
  32. +1 −2 graphics/bitmap.d
  33. +1 −2 graphics/view.d
  34. +2 −2 gui/hscrollbar.d
  35. +2 −2 gui/vscrollbar.d
  36. +45 −40 io/console.d
  37. +11 −5 math/common.d
  38. +2 −1 platform/unix/common.d
  39. +8 −4 platform/unix/main.d
  40. +3 −26 platform/unix/platform/definitions.d
  41. +2 −0 platform/unix/platform/vars/file.d
  42. +4 −0 platform/unix/platform/vars/thread.d
  43. +1 −0 platform/unix/scaffold/console.d
  44. +2 −0 platform/unix/scaffold/cui.d
  45. +2 −0 platform/unix/scaffold/file.d
  46. +46 −70 platform/unix/scaffold/thread.d
  47. +2 −0 platform/unix/scaffold/time.d
  48. +1 −1 resource/sound.d
  49. +9 −2 runtests.d
  50. +17 −12 runtime/array.d
  51. +228 −31 runtime/assocarray.d
  52. +0 −39 runtime/classinfo.d
  53. +4 −1 runtime/classinvariant.d
  54. +1 −0 runtime/common.d
  55. +0 −1 runtime/dstatic.d
  56. +5 −2 runtime/error.d
  57. +402 −7 runtime/exception.d
  58. +41 −5 runtime/gc.d
  59. +214 −33 runtime/lifetime.d
  60. +151 −3 runtime/main.d
  61. +51 −17 runtime/moduleinfo.d
  62. +48 −0 runtime/monitor.d
  63. +132 −23 runtime/object.d
  64. +1 −3 runtime/typeinfo.d
  65. +9 −5 runtime/{typeinfo → typeinfos}/ti_array.d
  66. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_bool.d
  67. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_byte.d
  68. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_cdouble.d
  69. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_cfloat.d
  70. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_char.d
  71. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_creal.d
  72. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_dchar.d
  73. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_double.d
  74. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_float.d
  75. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_idouble.d
  76. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_ifloat.d
  77. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_int.d
  78. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_ireal.d
  79. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_long.d
  80. +1 −1 runtime/{typeinfo → typeinfos}/ti_array_object.d
  81. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_real.d
  82. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_short.d
  83. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_ubyte.d
  84. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_uint.d
  85. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_ulong.d
  86. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_ushort.d
  87. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_void.d
  88. +2 −2 runtime/{typeinfo → typeinfos}/ti_array_wchar.d
  89. +2 −0 runtime/{typeinfo → typeinfos}/ti_assocarray.d
  90. +1 −1 runtime/{typeinfo → typeinfos}/ti_byte.d
  91. +1 −1 runtime/{typeinfo → typeinfos}/ti_cdouble.d
  92. +1 −1 runtime/{typeinfo → typeinfos}/ti_cfloat.d
  93. +1 −1 runtime/{typeinfo → typeinfos}/ti_char.d
  94. +1 −1 runtime/{typeinfo → typeinfos}/ti_creal.d
  95. +1 −1 runtime/{typeinfo → typeinfos}/ti_dchar.d
  96. +1 −1 runtime/{typeinfo → typeinfos}/ti_delegate.d
  97. +8 −2 runtime/{typeinfo → typeinfos}/ti_double.d
  98. +2 −2 runtime/{typeinfo → typeinfos}/ti_enum.d
  99. +1 −3 runtime/{typeinfo → typeinfos}/ti_float.d
  100. +1 −1 runtime/{typeinfo → typeinfos}/ti_function.d
  101. +2 −2 runtime/{typeinfo → typeinfos}/ti_idouble.d
  102. +2 −2 runtime/{typeinfo → typeinfos}/ti_ifloat.d
  103. +1 −1 runtime/{typeinfo → typeinfos}/ti_int.d
  104. +2 −0 runtime/{typeinfo → typeinfos}/ti_interface.d
  105. +2 −2 runtime/{typeinfo → typeinfos}/ti_ireal.d
  106. +1 −1 runtime/{typeinfo → typeinfos}/ti_long.d
  107. +1 −1 runtime/{typeinfo → typeinfos}/ti_object.d
  108. +1 −1 runtime/{typeinfo → typeinfos}/ti_ptr.d
  109. +1 −3 runtime/{typeinfo → typeinfos}/ti_real.d
  110. +1 −1 runtime/{typeinfo → typeinfos}/ti_short.d
  111. +3 −1 runtime/{typeinfo → typeinfos}/ti_staticarray.d
  112. +3 −1 runtime/{typeinfo → typeinfos}/ti_struct.d
  113. +1 −1 runtime/{typeinfo → typeinfos}/ti_tuple.d
  114. +1 −1 runtime/{typeinfo → typeinfos}/ti_typedef.d
  115. +1 −1 runtime/{typeinfo → typeinfos}/ti_ubyte.d
  116. +1 −1 runtime/{typeinfo → typeinfos}/ti_uint.d
  117. +1 −1 runtime/{typeinfo → typeinfos}/ti_ulong.d
  118. +1 −1 runtime/{typeinfo → typeinfos}/ti_ushort.d
  119. +1 −1 runtime/{typeinfo → typeinfos}/ti_void.d
  120. +1 −1 runtime/{typeinfo → typeinfos}/ti_wchar.d
  121. +0 −24 runtime/types.d
  122. +113 −0 runtime/util.d
  123. +4 −1 spec/itemspecification.d
  124. +1 −0 spec/packagespecification.d
  125. +3 −3 spec/test.d
  126. +1 −1 specs/data/queue.ds
  127. +65 −0 specs/runtime/synchronized.ds
  128. +8 −4 synch/semaphore.d
  129. +29 −157 synch/thread.d
  130. +26 −47 synch/timer.d
  131. +80 −11 winsamp.d
View
@@ -8,9 +8,9 @@ DFLAGS =
# can be changed
PLATFORM = WINDOWS
-LFLAGS_LINUX = -Iplatform/unix -L-lX11 -L-lc -L-lm -L-lrt -L-lcairo -L-lpango-1.0 -L-lpangocairo-1.0 -L-lGL -L-llua5.1 -L-lncurses -J./tests
-LFLAGS_MAC = -lobjc -framework Cocoa -framework Foundation -framework OpenGL -lncurses -llua5.1
-LFLAGS_WIN = -Iplatform/win
+LFLAGS_LINUX = -Iplatform/unix -Icompiler -L-lX11 -L-lc -L-lm -L-lrt -L-lcairo -L-lpango-1.0 -L-lpangocairo-1.0 -L-lGL -L-llua5.1 -L-lncurses -J./tests
+LFLAGS_MAC = -lobjc -framework Cocoa -framework Foundation -framework OpenGL -lncurses -llua5.1 -Icompiler
+LFLAGS_WIN = -Iplatform/win -Icompiler
ifeq (${MY_ARCH},MINGW32_NT-5.1)
OBJEXT = .obj
@@ -33,16 +33,17 @@ endif
DFILES_PLATFORM_MAC = platform/osx/platform/application.d platform/osx/scaffold/system.d platform/osx/scaffold/thread.d platform/osx/scaffold/time.d platform/osx/scaffold/console.d platform/osx/platform/definitions.d platform/osx/common.d platform/osx/main.d platform/osx/scaffold/opengl.d platform/osx/scaffold/graphics.d platform/osx/scaffold/file.d platform/osx/scaffold/socket.d platform/osx/scaffold/window.d platform/osx/scaffold/color.d platform/osx/scaffold/menu.d platform/osx/scaffold/wave.d platform/osx/scaffold/view.d platform/osx/scaffold/directory.d platform/osx/gui/apploop.d binding/c.d binding/ncurses/ncurses.d platform/osx/scaffold/cui.d platform/osx/platform/vars/cui.d platform/osx/platform/vars/file.d platform/unix/common.d platform/osx/platform/vars/thread.d platform/osx/platform/vars/directory.d platform/osx/platform/vars/view.d platform/osx/platform/vars/semaphore.d platform/osx/platform/vars/condition.d platform/osx/platform/vars/window.d
OBJC_FILES = platform/osx/objc/window.m platform/osx/objc/app.m platform/osx/objc/view.m
-DFILES_PLATFORM_UNIX = platform/unix/platform/application.d platform/unix/scaffold/system.d platform/unix/scaffold/thread.d platform/unix/scaffold/time.d platform/unix/scaffold/console.d platform/unix/platform/definitions.d platform/unix/common.d binding/cairo/cairo.d binding/x/Xlib.d binding/x/X.d platform/unix/main.d platform/unix/scaffold/opengl.d platform/unix/scaffold/graphics.d platform/unix/scaffold/file.d platform/unix/scaffold/socket.d platform/unix/scaffold/window.d platform/unix/scaffold/color.d platform/unix/scaffold/menu.d platform/unix/scaffold/wave.d platform/unix/scaffold/view.d platform/unix/scaffold/directory.d platform/unix/gui/apploop.d platform/unix/gui/osbutton.d binding/c.d binding/ncurses/ncurses.d platform/unix/scaffold/cui.d platform/unix/platform/vars/cui.d
+DFILES_PLATFORM_UNIX = platform/unix/platform/application.d platform/unix/scaffold/system.d platform/unix/scaffold/thread.d platform/unix/scaffold/time.d platform/unix/scaffold/console.d platform/unix/platform/definitions.d platform/unix/common.d binding/cairo/cairo.d binding/x/Xlib.d binding/x/X.d platform/unix/main.d platform/unix/scaffold/opengl.d platform/unix/scaffold/graphics.d platform/unix/scaffold/file.d platform/unix/scaffold/socket.d platform/unix/scaffold/window.d platform/unix/scaffold/color.d platform/unix/scaffold/menu.d platform/unix/scaffold/wave.d platform/unix/scaffold/view.d platform/unix/scaffold/directory.d platform/unix/gui/apploop.d platform/unix/gui/osbutton.d binding/c.d binding/ncurses/ncurses.d platform/unix/scaffold/cui.d platform/unix/platform/vars/cui.d platform/unix/platform/vars/wave.d platform/unix/platform/vars/window.d platform/unix/platform/vars/menu.d platform/unix/platform/vars/view.d platform/unix/platform/vars/region.d platform/unix/platform/vars/brush.d platform/unix/platform/vars/pen.d platform/unix/platform/vars/font.d binding/pango/pango.d platform/unix/platform/vars/directory.d platform/unix/platform/vars/file.d platform/unix/platform/vars/thread.d platform/unix/platform/vars/mutex.d platform/unix/platform/vars/semaphore.d platform/unix/platform/vars/library.d platform/unix/platform/vars/socket.d platform/unix/platform/vars/condition.d binding/cairo/xlib.d binding/cairo/features.d binding/pango/font.d binding/pango/types.d binding/pango/context.d binding/pango/pbreak.d binding/pango/engine.d binding/pango/fontset.d binding/pango/coverage.d binding/pango/glyph.d binding/pango/matrix.d binding/pango/attributes.d binding/pango/layout.d binding/pango/cairo.d binding/pango/script.d binding/pango/gravity.d binding/pango/fontmap.d binding/pango/item.d binding/pango/tabs.d binding/pango/glyphitem.d compiler/ldc/vararg.d compiler/ldc/cstdarg.d
DFILES_PLATFORM_WIN = binding/win32/gdipluscolormatrix.d binding/win32/gdiplusinit.d binding/win32/gdiplusmem.d binding/win32/gdiplusbase.d binding/win32/gdiplusflat.d binding/win32/gdiplusstringformat.d binding/win32/gdiplusmetafile.d binding/win32/gdipluslinecaps.d binding/win32/gdiplusimagecodec.d binding/win32/gdiplusgpstubs.d binding/win32/gdiplusfontfamily.d binding/win32/gdiplusfontcollection.d binding/win32/gdiplusfont.d binding/win32/gdiplusenums.d binding/win32/gdiplustypes.d binding/win32/gdiplusregion.d binding/win32/gdipluscolor.d binding/win32/gdiplusbitmap.d binding/win32/gdipluseffects.d binding/win32/gdipluscachedbitmap.d binding/win32/gdipluspath.d binding/win32/gdiplusbrush.d binding/win32/gdipluspen.d binding/win32/gdiplusgraphics.d binding/win32/ws2def.d binding/win32/winsock2.d binding/win32/inaddr.d binding/win32/mmsystem.d binding/win32/wincon.d binding/win32/winbase.d binding/win32/winuser.d binding/win32/windef.d binding/win32/wingdi.d platform/win/platform/application.d platform/win/platform/vars/cui.d platform/win/scaffold/cui.d platform/win/scaffold/system.d platform/win/main.d platform/win/common.d platform/win/platform/vars/menu.d platform/win/platform/vars/view.d platform/win/platform/vars/semaphore.d platform/win/platform/vars/mutex.d platform/win/platform/vars/region.d platform/win/platform/vars/library.d platform/win/platform/vars/wave.d platform/win/platform/vars/pen.d platform/win/platform/vars/brush.d platform/win/platform/vars/window.d platform/win/platform/vars/file.d platform/win/platform/vars/directory.d platform/win/platform/vars/font.d platform/win/platform/vars/socket.d platform/win/scaffold/console.d platform/win/platform/definitions.d platform/win/scaffold/wave.d platform/win/scaffold/directory.d platform/win/scaffold/graphics.d platform/win/scaffold/thread.d platform/win/scaffold/menu.d platform/win/scaffold/window.d platform/win/scaffold/view.d platform/win/scaffold/color.d platform/win/scaffold/file.d platform/win/scaffold/socket.d platform/win/gui/osbutton.d platform/win/scaffold/time.d platform/win/widget.d platform/win/scaffold/opengl.d platform/win/widget.d platform/win/gui/apploop.d
DFILES_PLATFORM_XOMB = platform/xomb/main.d platform/xomb/common.d platform/xomb/scaffold.d platform/xomb/vars.d platform/xomb/console.d platform/xomb/definitions.d platform/xomb/scaffolds/wave.d platform/xomb/scaffolds/graphics.d platform/xomb/scaffolds/thread.d platform/xomb/scaffolds/menu.d platform/xomb/scaffolds/window.d platform/xomb/scaffolds/view.d platform/xomb/scaffolds/color.d platform/xomb/scaffolds/file.d platform/xomb/scaffolds/socket.d platform/xomb/scaffolds/app.d platform/xomb/scaffolds/time.d platform/xomb/oscontrolinterface.d
DFILES_ANALYZING = analyzing/debugger.d
DFILES_LOCALES = locales/en_us.d locales/fr_fr.d locales/all.d
-DFILES_CORE = core/date.d core/locale.d core/variant.d core/exception.d core/event.d core/library.d core/system.d core/regex.d core/arguments.d core/definitions.d core/application.d core/time.d core/timezone.d core/unicode.d core/endian.d core/stream.d core/string.d core/main.d core/color.d core/error.d
+DFILES_CORE = core/date.d core/locale.d core/variant.d core/exception.d core/event.d core/library.d core/system.d core/regex.d core/arguments.d core/definitions.d core/application.d core/time.d core/timezone.d core/unicode.d core/endian.d core/stream.d core/string.d core/main.d core/color.d core/error.d core/util.d
DFILES_GUI = gui/container.d gui/trackbar.d gui/radiogroup.d gui/progressbar.d gui/togglefield.d gui/listfield.d gui/listbox.d gui/vscrollbar.d gui/hscrollbar.d gui/button.d gui/textfield.d gui/window.d gui/widget.d gui/application.d
DFILES_DATA = data/stack.d data/queue.d data/queue2.d data/fibonacci.d data/heap.d data/list.d data/iterable.d
-DFILES_RUNTIME = #runtime/array.d runtime/apply.d #runtime/lifetime.d runtime/gc.d runtime/exception.d
+DFILES_RUNTIME = runtime/dstatic.d runtime/switchstmt.d runtime/monitor.d runtime/array.d runtime/apply.d runtime/lifetime.d runtime/gc.d runtime/exception.d runtime/object.d runtime/typeinfo.d runtime/moduleinfo.d runtime/assocarray.d runtime/classinvariant.d runtime/error.d runtime/typeinfos/ti_array.d runtime/typeinfos/ti_array_bool.d runtime/typeinfos/ti_array_byte.d runtime/typeinfos/ti_array_cdouble.d runtime/typeinfos/ti_array_cfloat.d runtime/typeinfos/ti_array_char.d runtime/typeinfos/ti_array_creal.d runtime/typeinfos/ti_array_dchar.d runtime/typeinfos/ti_array_double.d runtime/typeinfos/ti_array_float.d runtime/typeinfos/ti_array_idouble.d runtime/typeinfos/ti_array_ifloat.d runtime/typeinfos/ti_array_int.d runtime/typeinfos/ti_array_ireal.d runtime/typeinfos/ti_array_long.d runtime/typeinfos/ti_array_object.d runtime/typeinfos/ti_array_real.d runtime/typeinfos/ti_array_short.d runtime/typeinfos/ti_array_ubyte.d runtime/typeinfos/ti_array_uint.d runtime/typeinfos/ti_array_ulong.d runtime/typeinfos/ti_array_ushort.d runtime/typeinfos/ti_array_void.d runtime/typeinfos/ti_array_wchar.d runtime/typeinfos/ti_assocarray.d runtime/typeinfos/ti_byte.d runtime/typeinfos/ti_cdouble.d runtime/typeinfos/ti_cfloat.d runtime/typeinfos/ti_char.d runtime/typeinfos/ti_creal.d runtime/typeinfos/ti_dchar.d runtime/typeinfos/ti_delegate.d runtime/typeinfos/ti_double.d runtime/typeinfos/ti_enum.d runtime/typeinfos/ti_float.d runtime/typeinfos/ti_function.d runtime/typeinfos/ti_idouble.d runtime/typeinfos/ti_ifloat.d runtime/typeinfos/ti_int.d runtime/typeinfos/ti_interface.d runtime/typeinfos/ti_ireal.d runtime/typeinfos/ti_long.d runtime/typeinfos/ti_object.d runtime/typeinfos/ti_ptr.d runtime/typeinfos/ti_real.d runtime/typeinfos/ti_short.d runtime/typeinfos/ti_staticarray.d runtime/typeinfos/ti_struct.d runtime/typeinfos/ti_tuple.d runtime/typeinfos/ti_typedef.d runtime/typeinfos/ti_ubyte.d runtime/typeinfos/ti_uint.d runtime/typeinfos/ti_ulong.d runtime/typeinfos/ti_ushort.d runtime/typeinfos/ti_void.d runtime/typeinfos/ti_wchar.d runtime/util.d runtime/common.d runtime/main.d
+
DFILES_PARSING = parsing/d/trees.d parsing/d/addexprunit.d parsing/d/andexprunit.d parsing/d/assignexprunit.d parsing/d/blockstmtunit.d parsing/d/switchstmtunit.d parsing/d/casestmtunit.d parsing/d/defaultstmtunit.d parsing/d/breakstmtunit.d parsing/d/continuestmtunit.d parsing/d/gotostmtunit.d parsing/d/returnstmtunit.d parsing/d/volatilestmtunit.d parsing/d/throwstmtunit.d parsing/d/postfixexprlistunit.d parsing/d/cmpexprunit.d parsing/d/conditionalexprunit.d parsing/d/declarationunit.d parsing/d/expressionunit.d parsing/d/importdeclunit.d parsing/d/isexprunit.d parsing/d/lexer.d parsing/d/logicalandexprunit.d parsing/d/logicalorexprunit.d parsing/d/moduledeclunit.d parsing/d/moduleunit.d parsing/d/mulexprunit.d parsing/d/nodes.d parsing/d/orexprunit.d parsing/d/parser.d parsing/d/postfixexprunit.d parsing/d/primaryexprunit.d parsing/d/shiftexprunit.d parsing/d/staticunit.d parsing/d/declaratorunit.d parsing/d/declaratorsuffixunit.d parsing/d/declaratortypeunit.d parsing/d/tokens.d parsing/d/enumdeclunit.d parsing/d/typeunit.d parsing/d/enumbodyunit.d parsing/d/aggregatedeclunit.d parsing/d/aggregatebodyunit.d parsing/d/classbodyunit.d parsing/d/templatebodyunit.d parsing/d/interfacebodyunit.d parsing/d/classdeclunit.d parsing/d/interfacedeclunit.d parsing/d/constructorunit.d parsing/d/destructorunit.d parsing/d/parameterlistunit.d parsing/d/functionbodyunit.d parsing/d/staticifunit.d parsing/d/versionunit.d parsing/d/debugunit.d parsing/d/unittestunit.d parsing/d/parameterunit.d parsing/d/basictypeunit.d parsing/d/statementunit.d parsing/d/pragmastmtunit.d parsing/d/staticassertunit.d parsing/d/foreachstmtunit.d parsing/d/scopedstmtunit.d parsing/d/forstmtunit.d parsing/d/typedeclarationunit.d parsing/d/unaryexprunit.d parsing/d/xorexprunit.d parsing/ast.d parsing/lexer.d parsing/token.d parsing/parser.d parsing/options.d parsing/cfg.d parsing/parseunit.d
DFILES = djehuty.d
DFILES_BINARY_CODECS = decoders/binary/decoder.d decoders/binary/base64.d decoders/binary/yEnc.d decoders/binary/deflate.d decoders/binary/zlib.d
@@ -65,7 +66,7 @@ DFILES_TESTING = spec/support.d spec/logic.d spec/itemspecification.d spec/packa
DFILES_SYNCH = synch/atomic.d synch/condition.d synch/barrier.d synch/mutex.d synch/semaphore.d synch/thread.d synch/timer.d
DFILES_RSC =
-DFILES_SPECS = .specs/runtime/array.d .specs/runtime/foreach.d .specs/core/application.d .specs/core/arguments.d .specs/core/date.d .specs/core/exception.d .specs/core/regex.d .specs/core/string.d .specs/core/time.d .specs/core/unicode.d .specs/core/util.d .specs/core/variant.d .specs/data/fibonacci.d .specs/data/heap.d .specs/data/queue.d .specs/data/stack.d .specs/hashes/digest.d .specs/hashes/md5.d .specs/hashes/sha1.d .specs/hashes/sha224.d .specs/hashes/sha256.d .specs/math/random.d .specs/runtime/switch.d
+DFILES_SPECS = .specs/runtime/array.d .specs/runtime/foreach.d .specs/core/application.d .specs/core/arguments.d .specs/core/date.d .specs/core/exception.d .specs/core/regex.d .specs/core/string.d .specs/core/time.d .specs/core/unicode.d .specs/core/util.d .specs/core/variant.d .specs/data/fibonacci.d .specs/data/heap.d .specs/data/queue.d .specs/data/stack.d .specs/hashes/digest.d .specs/hashes/md5.d .specs/hashes/sha1.d .specs/hashes/sha224.d .specs/hashes/sha256.d .specs/math/random.d .specs/runtime/switch.d .specs/runtime/synchronized.d .specs/math/common.d
SOURCES = $(DFILES_SPECS) $(DFILES) $(DFILES_RUNTIME) $(DFILES_LOCALES) $(DFILES_RESOURCE) $(DFILES_IO) $(DFILES_SYNCH) $(DFILES_PARSING) $(DFILES_OPENGL) $(DFILES_CUI) $(DFILES_ANALYZING) $(DFILES_SCRIPTING) $(DFILES_BINDING) $(DFILES_TESTING) $(DFILES_MATH) $(DFILES_GRAPHICS) $(DFILES_HASHES) $(DFILES_RSC) $(DFILES_NETWORKING) $(DFILES_INTERFACES) $(DFILES_DATA) $(DFILES_CONSOLE) $(DFILES_BINARY_CODECS) $(DFILES_CODEC) $(DFILES_IMAGE_CODECS) $(DFILES_AUDIO_CODECS) $(DFILES_CORE) $(DFILES_GUI) $(DFILES_PARSERS)
@@ -109,7 +110,7 @@ ifeq (${MY_ARCH},Darwin)
else
ifeq ($(PLATFORM),"WINDOWS")
else
- @$(DC) $< $(DFLAGS) -d-version=PlatformLinux -c -of$@ -O3 -J./tests -I./platform/unix
+ @$(DC) $< $(DFLAGS) -d-version=PlatformLinux -c -of$@ -O3 -J./tests -I./platform/unix -I./compiler
endif
endif
View
@@ -17,6 +17,8 @@ import djehuty;
import synch.thread;
+import binding.c;
+
// Description: This class provides a set of functions to facilitate common
// debugging functions and capabilities to profile code.
// Feature: Provides a method of logging all debug information to a file.
@@ -28,6 +30,9 @@ static:
public:
void raiseException(Exception e, Window w = null, Thread t = null) {
+
+ printf("exception %s\n", e.msg.ptr);
+
if (_delegate !is null) {
// Wouldn't it be ridiculous if the handler threw an exception?
try {
View
@@ -8,6 +8,8 @@
*
*/
+module binding.c;
+
/* C long types */
version(GNU) {
@@ -26,23 +28,186 @@ else {
/* stdarg */
-version(Tango) {
- public import tango.stdc.stdarg;
- public import tango.stdc.stdio : wchar_t, stdout, _iobuf, FILE, fpos_t;
-
- extern(C) int printf(char *,...); ///
+version(GNU) {
+ private import std.c.stdarg;
+ alias va_list Cva_list;
+}
+else version(LDC) {
+ private import ldc.cstdarg;
+ alias va_list Cva_list;
}
else {
- public import std.c.stdarg;
- version(GNU) {
- public import gcc.config.libc;
- alias gcc.config.libc.fpos_t fpos_t;
+ static assert(false, "Compiler not supported.");
+ // public import std.c.stdarg
+}
+
+/* stdout */
+
+align(1) struct _iobuf {
+ version( Win32 ) {
+ char* _ptr;
+ int _cnt;
+ char* _base;
+ int _flag;
+ int _file;
+ int _charbuf;
+ int _bufsiz;
+ int __tmpnum;
+ }
+ else version( linux ) {
+ char* _read_ptr;
+ char* _read_end;
+ char* _read_base;
+ char* _write_base;
+ char* _write_ptr;
+ char* _write_end;
+ char* _buf_base;
+ char* _buf_end;
+ char* _save_base;
+ char* _backup_base;
+ char* _save_end;
+ void* _markers;
+ _iobuf* _chain;
+ int _fileno;
+ int _blksize;
+ int _old_offset;
+ ushort _cur_column;
+ byte _vtable_offset;
+ char[1] _shortbuf;
+ void* _lock;
+ }
+ else version( darwin ) {
+ ubyte* _p;
+ int _r;
+ int _w;
+ short _flags;
+ short _file;
+ __sbuf _bf;
+ int _lbfsize;
+
+ int* function(void*) _close;
+ int* function(void*, char*, int) _read;
+ fpos_t* function(void*, fpos_t, int) _seek;
+ int* function(void*, char *, int) _write;
+
+ __sbuf _ub;
+ __sFILEX* _extra;
+ int _ur;
+
+ ubyte[3] _ubuf;
+ ubyte[1] _nbuf;
+
+ __sbuf _lb;
+
+ int _blksize;
+ fpos_t _offset;
+ }
+ else version( freebsd ) {
+ ubyte* _p;
+ int _r;
+ int _w;
+ short _flags;
+ short _file;
+ __sbuf _bf;
+ int _lbfsize;
+
+ void* function() _cookie;
+ int* function(void*) _close;
+ int* function(void*, char*, int) _read;
+ fpos_t* function(void*, fpos_t, int) _seek;
+ int* function(void*, char *, int) _write;
+
+ __sbuf _ub;
+ __sFILEX* _extra;
+ int _ur;
+
+ ubyte[3] _ubuf;
+ ubyte[1] _nbuf;
+
+ __sbuf _lb;
+
+ int _blksize;
+ fpos_t _offset;
+ }
+ else version( solaris ) {
+ // From OpenSolaris <ast/sfio_s.h>
+ ubyte* _next; /* next position to read/write from */
+ ubyte* _endw; /* end of write buffer */
+ ubyte* _endr; /* end of read buffer */
+ ubyte* _endb; /* end of buffer */
+ _iobuf* _push; /* the stream that was pushed on */
+ ushort _flags; /* type of stream */
+ short _file; /* file descriptor */
+ ubyte* _data; /* base of data buffer */
+ ptrdiff_t _size; /* buffer size */
+ ptrdiff_t _val; /* values or string lengths */
+
+ // #ifdef _SFIO_PRIVATE
+ // .. I don't think we really need this in D
+ // #endif
}
else {
- public import std.c.stdio;
+ static assert( false, "Platform not supported." );
}
}
+const int _NFILE = 60;
+alias _iobuf FILE;
+alias int fpos_t;
+
+version(Win32) {
+ extern(C) extern FILE[_NFILE] _iob;
+ FILE* stdin = &_iob[0];
+ FILE* stdout = &_iob[1];
+ FILE* stderr = &_iob[2];
+}
+else version(linux) {
+ extern(C) extern FILE* stdin;
+ extern(C) extern FILE* stdout;
+ extern(C) extern FILE* stderr;
+}
+else version(darwin) {
+ extern(C) extern FILE* __stdinp;
+ extern(C) extern FILE* __stdoutp;
+ extern(C) extern FILE* __stderrp;
+
+ alias __stdinp stdin;
+ alias __stdoutp stdout;
+ alias __stderrp stderr;
+}
+else version(freebsd) {
+ extern(C) extern FILE[3] __sF;
+
+ FILE* stdin = &__sF[0];
+ FILE* stdout = &__sF[1];
+ FILE* stderr = &__sF[2];
+}
+else version(solaris) {
+ extern(C) extern FILE[_NFILE] __iob;
+
+ FILE* stdin = &__iob[0];
+ FILE* stdout = &__iob[1];
+ FILE* stderr = &__iob[2];
+}
+else {
+ static assert(false, "Platform not supported.");
+}
+
+// wchar_t
+version(Win32) {
+ alias ushort wchar_t;
+}
+else {
+ alias uint wchar_t;
+}
+
+extern(C) FILE[_NFILE]* _imp__iob;
+
+ //public import std.c.stdarg;
+ //public import std.c.stdio;
+
+extern(C) int printf(char *,...);
+
const int EOF = -1;
const int FOPEN_MAX = 16;
const int FILENAME_MAX = 4095;
@@ -79,10 +244,10 @@ int ungetc(int,FILE *); ///
size_t fread(void *,size_t,size_t,FILE *); ///
size_t fwrite(void *,size_t,size_t,FILE *); ///
int fprintf(FILE *,char *,...); ///
-int vfprintf(FILE *,char *,va_list); ///
-int vprintf(char *,va_list); ///
+int vfprintf(FILE *,char *,Cva_list); ///
+int vprintf(char *,Cva_list); ///
int sprintf(char *,char *,...); ///
-int vsprintf(char *,char *,va_list); ///
+int vsprintf(char *,char *,Cva_list); ///
int scanf(char *,...); ///
int fscanf(FILE *,char *,...); ///
int sscanf(char *,char *,...); ///
Oops, something went wrong.

0 comments on commit ead8c19

Please sign in to comment.