Dstep Versions Save

A tool for converting C and Objective-C headers to D modules

v1.0.0

5 years ago

This is a new major version with a whole bunch of new features and bug fixes. The biggest features are support for translating some preprocessor directives like: #define for simple constants and function like macros. This release also adds support for a new platform, Windows.

Here's the full changelog:

New/Changed Features

  • Support for simple defines (like #define FOO 1)
  • Translation of defines to functions (like #define FOO(a, b) a + b)
  • Support for preprocessor token-pasting operator (##)
  • Support for translation of whole packages (--package CLI option)
  • Support for translation of preprocessor constants in array sizes
  • Support for global comments and comments inside structs and enums
  • Detecting collisions of renamed tag-space names (struct name_t ...) with existing ones
  • Special treatment of a comment before header guard
  • Support for removing excessive newlines and keeping original spacing
  • Basic unit tests were added
  • Cucumber tests were replaced with D-based tests
  • Statements are now translated in the original order as the input file
  • Multiple input files can be processed at once
  • Extend a functionality that automatically replaces aliases to basic types with their D equivalents
  • Add a switch --reduce-aliases which disables/enables the above functionality
  • Add a switch --alias-enum-members which enables generation of aliases for enum members in the global scope
  • Add a switch --translate-macros which can disable the translation of C macro definitions
  • Add the libclang bindings as a test case
  • Add support for Microsoft Windows
  • Run Windows tests on AppVeyor
  • Handle complex floating-point types.
  • Use the new alias syntax (alias Y = X) in the output
  • Support for custom global attributes (e.g. nothrow, @nogc)
  • Add support for building with LDC
  • Bump the minimum requirement D compilers to their latest version
  • Always test using the latest version of DMD and LDC, including beta and nightly builds
  • Bump the minimum requirement of libclang to 7.0.0
  • Automatically generate the libclang bindings using DStep
  • Add a switch --rename-enum-members, which enables stripping of superfluous prefixes from enum members.
  • Add a switch --normalize-modules, which enables changing the names of modules to the D conforming form.
  • Add support for bit fields.

Bugs Fixed

  • Issue 2: Self alias should be removed bug
  • Issue 8: Typedef and anonymous structs
  • Issue 10: Embedded struct not generated
  • Issue 20: #define (simplest cases only?)
  • Issue 21: wchar_t should be translated to core.stdc.stddef.wchar_t
  • Issue 28: Crashes if fed nonexistent header
  • Issue 29: Don't name anonymous enums
  • Issue 30: Single space inserted after function names
  • Issue 38: Spurious generation of variadic args rather than implicit void
  • Issue 39: Recognize and translate __attribute__((__packed__))
  • Issue 46: Generating code that will not compile
  • Issue 47: Treatment of #define enhancement
  • Issue 50: struct typedef generates recursive alias bug
  • Issue 59: Shouldn't dstep exit with status code when there is some kind of error
  • Issue 83: New multiline translation
  • Issue 85: dstep not converting const T x[] to const (T)* x
  • Issue 98: dstep segfaults: Unhandled type kind cast(CXTypeKind)119
  • Issue 107: Handle typedef of opaque structs.
  • Issue 114: Crash on recursive typedef.
  • Issue 116: Option --space-after-function-name doesn't work with function pointer syntax.
  • Issue 117: fatal error: 'limits.h' file not found.
  • Issue 123: Missing import for usage of #define constant.
  • Issue 137: struct member expansion.
  • Issue 138: Repeated declarations cause problems.
  • Issue 140: On enums and scope.
  • Issue 141: Use of _IO, _IOR, etc.
  • Issue 154: Falling back to blunt pre-processor phase.
  • Issue 157: Keep enum members when used as enum values.
  • Issue 158: Keep literals for enum values.
  • Issue 160: Translating typedef of function pointer doesn't take line length into consideration.
  • Issue 166: macro used in struct declaration not translated properly
  • Issue 192: Fail to convert nuklear
  • Issue 199: #define of types results in incorrect output
  • Issue 202: Invalid translation of C struct with typedef to D.
  • Issue 203: Octal constants not handled correctly
  • Issue 204: C INT_MAX not handled.
  • Issue 214: Cast inside macro not properly translated
  • Issue 216: can't alias to existing D type

v0.2.1

8 years ago

Version 0.2.1

New/Changed Features

  • Clang internal header files are now included in the executable
  • A script for testing multiple versions of libclang has been added
  • DStep outputs spaces instead of tabs for indentation
  • Update Clang bindings to 3.7.0
  • Run tests on Travis-CI

Objective-C

  • Selectors are translated to @selector("foo")
  • id is translated to ObjcObject

Bugs Fixed

  • Issue #42: Compile failure with DMD v2.0.68
  • Issue #37: Regression: clang 3.5 causes struct members to be defined again
  • Issue #26: dstep dumps core on a simple header

v0.1.0

10 years ago

The biggest news for this release is the support for new platforms. DStep is now available on Mac OS X, Linux and FreeBSD. On all of these platforms both 32bit and 64bit architectures are supported.

New/Changed Features

  • Add support for compiling as 64bit
  • Removed printing of output to stdout
  • Add support for and FreeBSD (32 and 64bit)
  • Infer the output filename of the input filename
  • Make arguments more consistent

Objective-C

  • Support for properties
  • Support for protocols
  • Support for categories

Bugs Fixed

  • Issue 1: Escape D keywords for function parameters
  • Issue 5: Forward declaration of structures
  • Issue 4: Handle typedefs of empty struct

This tool requires libclang. Any version that is 3.1 or later and binary compatible with 3.1 should work. Either download the pre-compatible libraries from the LLVM site or use libclang shipping with your system or available from the system package manager. For more information see the readme.

Pre-compiled binaries of libclang: http://llvm.org/releases/download.html#3.1.