🍺 BREW Explorer

← all formulae

dpp

brew install dpp v0.6.0_1 BSL-1.0

Directly include C headers in D source code

1
30-day installs · #16441
7
90-day · #13539
30
365-day · #12631
245
★ GitHub stars · updated 2y ago

Build dependencies

GitHub topics

clang cpp cpp17 d dlang dlanguage libclang translation

Links

Raw metadata
{
  "aliases": [],
  "alternatives": [],
  "build_dependencies": [
    "dtools",
    "dub",
    "ldc"
  ],
  "categories": [],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Directly include C headers in D source code",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:37:06+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "dpp",
  "github_default_branch": "master",
  "github_last_commit_at": "2024-06-11T20:04:21Z",
  "github_readme_excerpt": "d++ - #include C and C++ headers in D files\n====================================================\n\n[![CI](https://github.com/atilaneves/dpp/actions/workflows/d.yml/badge.svg)](https://github.com/atilaneves/dpp/actions/workflows/d.yml)\n[![Coverage](https://codecov.io/gh/atilaneves/dpp/branch/master/graph/badge.svg)](https://codecov.io/gh/atilaneves/dpp)\n[![Open on run.dlang.io](https://img.shields.io/badge/run.dlang.io-open-blue.svg)](https://run.dlang.io/is/JK0CAf)\n\nGoal\n----\n\nTo directly `#include` C and C++ headers in [D](https://dlang.org) files and have the same semantics and ease-of-use\nas if the file had been `#included` from C or C++ themselves. Warts and all, meaning that C `enum` declarations\nwill pollute the global namespace, just as it does \"back home\".\n\nThis work was supported by [Symmetry Investments](http://symmetryinvestments.com/).\n\nExample\n-------\n\n```c\n// c.h\n#ifndef C_H\n#define C_H\n\n#define FOO_ID(x) (x*3)\n\nint twice(int i);\n\n#endif\n```\n\n```c\n// c.c\nint twice(int i) { return i * 2; }\n```\n\n```d\n// foo.dpp\n#include \"c.h\"\nvoid main() {\n    import std.stdio;\n    writeln(twice(FOO_ID(5)));  // yes, it\u0027s using a C macro here!\n}\n```\n\nAt the shell:\n\n```\n$ gcc -c c.c\n$ d++ foo.dpp c.o\n$ ./foo\n$ 30\n```\n\n[![Open on run.dlang.io](https://img.shields.io/badge/run.dlang.io-open-blue.svg)](https://run.dlang.io/is/WwpvhT)\n\nC++ support\n-----------\n\nC++ support is currently limited. Including any header from the C++\nstandard library is unlikely to work.  Simpler headers might, the\nprobability rising with how similar the C++ dialect used is to\nC. Despite that, dpp currently does try to translate classes,\ntemplates and operator overloading. It\u0027s unlikely to work on\nproduction headers without judicious use of the `--ignore-cursor` and\n`--ignore-namespace` command-line options.  When using these, the user\ncan then define their own versions of problematic declarations such as\n`std::vector`.\n\nLimitations\n-----------\n\n* Only known to work on Linux with libclang versions 6 ",
  "github_repo": "atilaneves/dpp",
  "github_stars": 245,
  "github_topics": [
    "clang",
    "cpp",
    "cpp17",
    "d",
    "dlang",
    "dlanguage",
    "libclang",
    "translation"
  ],
  "homepage": "https://github.com/atilaneves/dpp",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 1,
  "installs_365d": 30,
  "installs_90d": 7,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "BSL-1.0",
  "llm_generated_at": null,
  "llm_model": null,
  "name": "dpp",
  "oldnames": [],
  "one_liner": null,
  "optional_dependencies": [],
  "rank_30d": 16441,
  "rank_365d": 12631,
  "rank_90d": 13539,
  "raw_hash": "7def4c39cc1a6499",
  "recommended_dependencies": [],
  "revision": 1,
  "ruby_source_path": "Formula/d/dpp.rb",
  "tap": "homebrew/core",
  "test_dependencies": [
    "ldc"
  ],
  "uses_from_macos": [
    "llvm"
  ],
  "version_head": null,
  "version_stable": "0.6.0",
  "versioned_formulae": [],
  "why_use_this": null
}