[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: Cannot set header-args :includes with multiple includes [8.

From: Thierry Banel
Subject: Re: [O] Bug: Cannot set header-args :includes with multiple includes [8.2.7 (8.2.7-4-g880362-elpa @ /home/will/.emacs.d/elpa/org-20140616/)]
Date: Thu, 04 Sep 2014 21:47:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

Le 26/08/2014 18:24, Will Everett a écrit :
> I believe the :includes header argument is incorrectly parsing lists
> of includes for c++. This snippet:
> #+BEGIN_SRC C++ :includes <cstdio> <iostream>
> using namespace std;
> printf("Hello ");
> cout << "world";
> produces a compiler error:
> warning: extra tokens at end of #include directive
>  #include <cstdio> <iostream>

Here is a patch to fix the issue.

The :includes, :defines, :imports headers have been extended to accept
multiple items without parenthesis. All the following forms are now allowed:

:includes <stdio.h>
:includes <stdio.h> "strings.h" <assert>
:includes '(<stdio.h> <strings.h> <assert>)
:includes (mapcar (lambda (x) (concat "<std/" x ".h>")) '("abc" "def"
(same for :imports)

:defines AA 22 BB 33
:defines "AA 22 BB 33"
:defines '("abc 123" "def 456")
:defines (mapcar (lambda (x) (concat x " " x "_def")) '("A" "BB" "CCC"))

This works either in the header as here:

#+BEGIN_SRC C++ :includes <stdio.h> "strings.h" <assert>


or in a property drawer, like that:

  :includes: <stdio.h> "strings.h" <assert>

Have fun

Attachment: 0001-Enable-multiple-files-in-includes-header.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]