Skip to content

Added etc.c.compat. #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Added etc.c.compat. #265

wants to merge 2 commits into from

Conversation

gor-f-gyolchanyan
Copy link

The etc.c.compat module is designed to help interface to C code, compiled with various compilers and processors by providing compile-time symbols, such as built-in types with correct sizes for the chosen compiler and processor.

/// Size: 32 bits.
alias uint c_uint;

static if(comp == Compiler.GCC && proc == Processor.X86_64)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clang should be added here as well.

@jmdavis
Copy link
Member

jmdavis commented Sep 22, 2011

What does this add that druntime doesn't already provide? This is the sort of thing that goes in druntime and which is already there. I don't think that druntime has stuff that's specific to a C compiler like this, but because D already uses a C linker and has extern(C) and whatnot, I'm not sure that you really can divorce the C compiler from the druntime implementation like this. druntime is calling C stuff already and is therefore tied to specific sizes of integer types and the like, so I'm not sure that mixing C code from different C compilers is really going to work anyway unless they use exactly the same sizes for the C types.

kuettler pushed a commit to kuettler/phobos that referenced this pull request Feb 6, 2018
leave it to user to build d-tags.json
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants