{"action":"created","issue":{"url":"https://api.github.com/repos/Syniurge/Calypso/issues/11","labels_url":"https://api.github.com/repos/Syniurge/Calypso/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/Syniurge/Calypso/issues/11/comments","events_url":"https://api.github.com/repos/Syniurge/Calypso/issues/11/events","html_url":"https://github.com/Syniurge/Calypso/pull/11","id":69392819,"number":11,"title":"Change StringLiteral mapping for wide chars and add a test case.","user":{"login":"wilsonk","id":38802,"avatar_url":"https://avatars.githubusercontent.com/u/38802?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonk","html_url":"https://github.com/wilsonk","followers_url":"https://api.github.com/users/wilsonk/followers","following_url":"https://api.github.com/users/wilsonk/following{/other_user}","gists_url":"https://api.github.com/users/wilsonk/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonk/subscriptions","organizations_url":"https://api.github.com/users/wilsonk/orgs","repos_url":"https://api.github.com/users/wilsonk/repos","events_url":"https://api.github.com/users/wilsonk/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-19T06:40:00Z","updated_at":"2015-04-21T17:44:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Syniurge/Calypso/pulls/11","html_url":"https://github.com/Syniurge/Calypso/pull/11","diff_url":"https://github.com/Syniurge/Calypso/pull/11.diff","patch_url":"https://github.com/Syniurge/Calypso/pull/11.patch"},"body":"I was getting some errors when trying to build a library with something similar to the test case. The mapping seems to work in one direction, but going back from D->C++ still gives an error. The type getting through to cpptypes.cpp(1819):toType is a 'const(int)*' and it appears as though that int is not being seen as a builtin type? The switch(t->ty) will match against a Tint32, which I figured should map easily to a builtin type with toClang[t] in the line above?? Not sure what is going on there.\r\n\r\nThanks,\r\nKelly"},"comment":{"url":"https://api.github.com/repos/Syniurge/Calypso/issues/comments/94884736","html_url":"https://github.com/Syniurge/Calypso/pull/11#issuecomment-94884736","issue_url":"https://api.github.com/repos/Syniurge/Calypso/issues/11","id":94884736,"user":{"login":"wilsonk","id":38802,"avatar_url":"https://avatars.githubusercontent.com/u/38802?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonk","html_url":"https://github.com/wilsonk","followers_url":"https://api.github.com/users/wilsonk/followers","following_url":"https://api.github.com/users/wilsonk/following{/other_user}","gists_url":"https://api.github.com/users/wilsonk/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonk/subscriptions","organizations_url":"https://api.github.com/users/wilsonk/orgs","repos_url":"https://api.github.com/users/wilsonk/repos","events_url":"https://api.github.com/users/wilsonk/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonk/received_events","type":"User","site_admin":false},"created_at":"2015-04-21T17:44:26Z","updated_at":"2015-04-21T17:44:26Z","body":"Hello Elie,\n\n \n\nI knew about the -cM and -cMH  options…they are in the help message, but it is good to know that only one module can be loaded at a time and that I need to specify the -cMH option if my header isn’t in /usr/include. \n\n \n\nLoading the stdc.ctype modulemap actually only works here with ‘import (C++) stdc.ctype;’?!? Not sure if you are seeing the same thing.\n\n \n\nAdding this modulemap to the showcase example allows things to compile with the proper -cM options, but I still can’t access any variables or functions. Have you actually used some ctype variables? Maybe the anonymous enum you spoke of? Or did you just get it to compile and not use any func/vars?\n\n \n\nThe reason I am doing this is that libzmq is pretty close to working right now but there is one header (and corresponding .cpp file) that contains a bunch of functions for starting up zmq sockets. I can rewrite them in D…but that is the point of Calypso, not to have to rewrite this stuff :)\n\n \n\nI managed to get the modulemap for zmq up and compiling here…almost. I get this error when compiling a simple main function with the modulemap and the minimum “zmq.hpp” imported:\n\n \n\nldc2: /home/wilsonk/Downloads/llvm-3.6/llvm/tools/clang/include/clang/Basic/SourceLocation.h:134: clang::SourceLocation clang::SourceLocation::getLocWithOffset(int) const: Assertion `((getOffset()+Offset) & MacroIDBit) == 0 && \"offset overflow\"' failed.\n\n#0 0x3a4ce7c llvm::sys::PrintStackTrace(_IO_FILE*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x3a4ce7c)\n\n#1 0x3a4d117 PrintStackTraceSignalHandler(void*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x3a4d117)\n\n#2 0x3a4bd39 SignalHandler(int) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x3a4bd39)\n\n#3 0x7fb9c3e82340 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)\n\n#4 0x7fb9c2c7dcc9 gsignal /build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0\n\n#5 0x7fb9c2c810d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0\n\n#6 0x7fb9c2c76b86 __assert_fail_base /build/buildd/eglibc-2.19/assert/assert.c:92:0\n\n#7 0x7fb9c2c76c32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)\n\n#8 0x142f2a9 clang::SourceLocation::getLocWithOffset(int) const (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x142f2a9)\n\n#9 0x186e468 clang::ASTReader::FindFileRegionDecls(clang::FileID, unsigned int, unsigned int, llvm::SmallVectorImpl<clang::Decl*>&) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x186e468)\n\n#10 0x129b6e3 cpp::reclang::ASTUnit::findFileRegionDecls(clang::FileID, unsigned int, unsigned int, llvm::SmallVectorImpl<clang::Decl*>&) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x129b6e3)\n\n#11 0x1286a12 cpp::mapClangModule(cpp::DeclMapper&, clang::Module*, Array<Dsymbol*>*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x1286a12)\n\n#12 0x128704c cpp::Module::load(Loc, Array<Identifier*>*, Identifier*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x128704c)\n\n#13 0x13bf7b5 cpp::Import::loadModule(Loc, Array<Identifier*>*, Identifier*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x13bf7b5)\n\n#14 0x112adf4 Import::load(Scope*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x112adf4)\n\n#15 0x13bf6b9 cpp::Import::load(Scope*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x13bf6b9)\n\n#16 0x112af02 Import::importAll(Scope*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x112af02)\n\n#17 0x11eb7d0 Module::importAll(Scope*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11eb7d0)\n\n#18 0x1103452 main (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x1103452)\n\n#19 0x7fb9c2c68ec5 __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:321:0\n\n#20 0x10d8489 _start (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x10d8489)\n\n./BUILD: line 15: 31075 Aborted                 ldc2 -cM=zeromq.modulemap -cMH=../include/ -cpp-args -I../include -cpp-args -DZMQ_USE_EPOLL -g -L-L/home/wilsonk/Downloads/libzmq/lib -L-lsodium -L-lstdc++ main.d ../lib/*.o\n\n \n\n \n\n**** The reason I say ‘minimum’ zmq.hpp imported is because: if you ONLY have a main function and a modulemap imported, then there is a segfault in  llvm::IntrusiveRefCntPtr<clang::ASTContext>::operator*() begin called from reclang->ASTUnit->getASTContext. Just making sure you are aware of this segfault when only importing a modulemap with no other imports. ******\n\n \n\nI will try to look at the ‘offset overflow’ error, I suppose, but I am not overly confident about being able to figure that one out. I have never worked with pch’s or module mapping, but no time like the present I guess :)\n\n \n\n.\n\n.\n\n.\n\n \n\nNow to one other thing….is there any way that you can contact me on IRC, please…..please, please, please, pretty please…or whatever I have to say??? This is so frustrating to only have contact through github!! We could have gone through this modulemap problem in under two minutes, if we were communicating directly, but it has been 24 hours instead and I got so frustrated that I went back to a different project last night, instead of banging my head against a wall over something that I knew was simple, but undocumented. I understand you are busy and don’t want to be pestered with a bunch of questions, but we really should have direct contact (when the time difference allows) to work more effectively together. If you just go to #ldc and personal message me with some obscure user name then nobody else will bother you, but at least we can resolve some issues quite a bit quicker that way. My username is wilsonk-laptop.\n\n \n\nThanks,\n\nKelly\n\n \n\n \n\n \n\n \n\n \n\n \n\nFrom: Elie Morisse [mailto:notifications@github.com] \nSent: Tuesday, April 21, 2015 8:01 AM\nTo: Syniurge/Calypso\nCc: wilsonk\nSubject: Re: [Calypso] Change StringLiteral mapping for wide chars and add a test case. (#11)\n\n \n\nTo load stdc.ctype it's import (C++) cpp.stdc.ctype; , and yes it's supposed to import global functions, variables, and anonymous tags (for example the anonymous enum in ctype.h).\n\n—\nReply to this email directly or view it on GitHub <https://github.com/Syniurge/Calypso/pull/11#issuecomment-94804341> .\n\n"}}