{"action":"closed","issue":{"url":"https://api.github.com/repos/nim-lang/c2nim/issues/51","labels_url":"https://api.github.com/repos/nim-lang/c2nim/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/nim-lang/c2nim/issues/51/comments","events_url":"https://api.github.com/repos/nim-lang/c2nim/issues/51/events","html_url":"https://github.com/nim-lang/c2nim/issues/51","id":108423438,"number":51,"title":"add option to include common preamble","user":{"login":"tmm1","id":2567,"avatar_url":"https://avatars.githubusercontent.com/u/2567?v=3","gravatar_id":"","url":"https://api.github.com/users/tmm1","html_url":"https://github.com/tmm1","followers_url":"https://api.github.com/users/tmm1/followers","following_url":"https://api.github.com/users/tmm1/following{/other_user}","gists_url":"https://api.github.com/users/tmm1/gists{/gist_id}","starred_url":"https://api.github.com/users/tmm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmm1/subscriptions","organizations_url":"https://api.github.com/users/tmm1/orgs","repos_url":"https://api.github.com/users/tmm1/repos","events_url":"https://api.github.com/users/tmm1/events{/privacy}","received_events_url":"https://api.github.com/users/tmm1/received_events","type":"User","site_admin":true},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-25T23:30:03Z","updated_at":"2015-09-25T23:43:50Z","closed_at":"2015-09-25T23:43:50Z","body":"I'm using c2nim with ffmpeg, which contains 98 header files. I would like to avoid patching every file for c2nim consumption (and then have to maintain that patch), since most of the headers fail to parse with the same errors. For instance, all the headers include [`libavutil/attributes.h`](https://github.com/ffmpeg/ffmpeg/blob/master/libavutil/attributes.h) which defines macros like `attribute_deprecated` and `av_const` that are used throughout the rest of the code base:\r\n\r\n``` c\r\nattribute_deprecated void func();\r\nint64_t av_const av_gcd(int64_t a, int64_t b);\r\nvoid func2(int av_unused flags);\r\n```\r\n\r\nI'd like to be able to pass c2nim a file that it parses before parsing the supplied header:\r\n\r\n```\r\n$ cat > common.h <<EOS\r\n#def av_unused\r\n#def av_const\r\n#def attribute_deprecated\r\nEOS\r\n$ c2nim --preamble common.h avcodec.h\r\n```\r\n"}}