<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to Work With Nested Includes on .edl files in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-Work-With-Nested-Includes-on-edl-files/m-p/1173553#M3294</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Hi&lt;BR /&gt;
	&lt;BR /&gt;
	Assuming I have an "&lt;STRONG&gt;enclave.&lt;/STRONG&gt;&lt;STRONG&gt;edl"&lt;/STRONG&gt;&amp;nbsp;file and&amp;nbsp; two header files "&lt;B&gt;definitions1.h&lt;/B&gt;" and "&lt;STRONG&gt;definitions2.h"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;when I use "&lt;STRONG&gt;second_type&lt;/STRONG&gt;" from "&lt;STRONG&gt;definitions2.h&lt;/STRONG&gt;" in my "&lt;STRONG&gt;enclave.edl&lt;/STRONG&gt;" it does not recognize it,&lt;BR /&gt;
	but when I use "&lt;STRONG&gt;first_type&lt;/STRONG&gt;" from "&lt;STRONG&gt;definitions1.h&lt;/STRONG&gt;" it works fine.&lt;BR /&gt;
	&lt;BR /&gt;
	why does that happen, and how can I make it work?&lt;BR /&gt;
	&lt;BR /&gt;
	(I can put all my definitions in the first header file but it creates a big mess.)&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;&lt;STRONG&gt;enclave.edl&lt;/STRONG&gt;
enclave
{
#include "definitions1.h"
    
    trusted 
    {   
          ecallFoo(second_type test);
    };

    untrusted 
    {

    };
};

&lt;STRONG&gt;definitions1.h&lt;/STRONG&gt;
#ifndef TRUSTED_DEFINITIONS1_H_
#define TRUSTED_DEFINITIONS1_H_

#include "definitions2.h"
#define first_type int

#endif /* TRUSTED_DEFINITIONS1_H_ */


&lt;STRONG&gt;definitions2.h&lt;/STRONG&gt;
#ifndef TRUSTED_DEFINITION2_H_
#define TRUSTED_DEFINITION2_H_

#define second_type int

#endif /* TRUSTED_DEFINITION2_H_ */&lt;/PRE&gt;

&lt;DIV&gt;
	&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Thu, 14 Dec 2017 15:06:59 GMT</pubDate>
    <dc:creator>Guy_M_</dc:creator>
    <dc:date>2017-12-14T15:06:59Z</dc:date>
    <item>
      <title>How to Work With Nested Includes on .edl files</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-Work-With-Nested-Includes-on-edl-files/m-p/1173553#M3294</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Hi&lt;BR /&gt;
	&lt;BR /&gt;
	Assuming I have an "&lt;STRONG&gt;enclave.&lt;/STRONG&gt;&lt;STRONG&gt;edl"&lt;/STRONG&gt;&amp;nbsp;file and&amp;nbsp; two header files "&lt;B&gt;definitions1.h&lt;/B&gt;" and "&lt;STRONG&gt;definitions2.h"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;when I use "&lt;STRONG&gt;second_type&lt;/STRONG&gt;" from "&lt;STRONG&gt;definitions2.h&lt;/STRONG&gt;" in my "&lt;STRONG&gt;enclave.edl&lt;/STRONG&gt;" it does not recognize it,&lt;BR /&gt;
	but when I use "&lt;STRONG&gt;first_type&lt;/STRONG&gt;" from "&lt;STRONG&gt;definitions1.h&lt;/STRONG&gt;" it works fine.&lt;BR /&gt;
	&lt;BR /&gt;
	why does that happen, and how can I make it work?&lt;BR /&gt;
	&lt;BR /&gt;
	(I can put all my definitions in the first header file but it creates a big mess.)&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;&lt;STRONG&gt;enclave.edl&lt;/STRONG&gt;
enclave
{
#include "definitions1.h"
    
    trusted 
    {   
          ecallFoo(second_type test);
    };

    untrusted 
    {

    };
};

&lt;STRONG&gt;definitions1.h&lt;/STRONG&gt;
#ifndef TRUSTED_DEFINITIONS1_H_
#define TRUSTED_DEFINITIONS1_H_

#include "definitions2.h"
#define first_type int

#endif /* TRUSTED_DEFINITIONS1_H_ */


&lt;STRONG&gt;definitions2.h&lt;/STRONG&gt;
#ifndef TRUSTED_DEFINITION2_H_
#define TRUSTED_DEFINITION2_H_

#define second_type int

#endif /* TRUSTED_DEFINITION2_H_ */&lt;/PRE&gt;

&lt;DIV&gt;
	&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 14 Dec 2017 15:06:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-Work-With-Nested-Includes-on-edl-files/m-p/1173553#M3294</guid>
      <dc:creator>Guy_M_</dc:creator>
      <dc:date>2017-12-14T15:06:59Z</dc:date>
    </item>
    <item>
      <title>The nested header file should</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-Work-With-Nested-Includes-on-edl-files/m-p/1173554#M3295</link>
      <description>&lt;P&gt;The nested header file should work. There are a couple of issues of the code that you provided:&lt;/P&gt;

&lt;P&gt;1. In the EDL trusted part, you should declare the function as public and have a return type such as&lt;/P&gt;

&lt;DIV&gt;&lt;SPAN style="font-size: 13.008px;"&gt;trusted&lt;/SPAN&gt;&lt;/DIV&gt;

&lt;DIV&gt;&lt;SPAN style="font-size: 13.008px;"&gt;{&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;

&lt;DIV&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp; &amp;nbsp; public void ecallFoo(second_type test);&lt;/SPAN&gt;&lt;/DIV&gt;

&lt;DIV&gt;&lt;SPAN style="font-size: 13.008px;"&gt;};&lt;/SPAN&gt;&lt;/DIV&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;2. Please remember that the EDL gets compiled so any definition of "#define second_type int" is translated back into "int" in the generated code. If you want to use second_type again, you simply need to add the "include" statement in the c/cpp file again such as&lt;/P&gt;

&lt;P&gt;#include "definitions1.h" or #include "definitions2.h"&lt;/P&gt;

&lt;P&gt;Please give a try and see whether the changes help.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 01:05:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-Work-With-Nested-Includes-on-edl-files/m-p/1173554#M3295</guid>
      <dc:creator>Hoang_N_Intel</dc:creator>
      <dc:date>2018-01-09T01:05:15Z</dc:date>
    </item>
  </channel>
</rss>

