x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Can UnreadHeaderTool handle #ifdef?

I tried to include a header conditionally, but I am getting the following error:

"In MyActor: Unmatched '#endif' in class or global scope"

Here is the relevant part of the header I am using #ifdef in:

 #pragma once
 
 #ifdef MYDEFINITION
 #include "Foo.h"
 #endif
 
 #include "GameFramework/Actor.h"
 #include "MyActor.generated.h"
 
 UCLASS()
 class AMyActor : public AActor

The header inside ifdef/endif isn't important - I get the same error even when there's nothing between ifdef and endif.

Is there a way around this problem?

Product Version: Not Selected
Tags:
more ▼

asked Apr 24 '14 at 08:53 PM in C++ Programming

avatar image

Element9
31 3 9 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

It seems that #ifdef (and #ifndef) aren't currently supported, however we have a pull request which should fix that: https://github.com/EpicGames/UnrealEngine/pull/67

Could you try using the following instead:

 #if defined MYDEFINITION
more ▼

answered Apr 24 '14 at 09:08 PM

avatar image

Jamie Dale STAFF
7.5k 177 67 307

avatar image Element9 Apr 24 '14 at 09:38 PM

"#if defined" does get handled correctly. I always used the #ifdef shorthand, so I forgot that the longer version even existed. Thank you.

avatar image Steve Robb STAFF May 06 '14 at 10:46 AM

Hi, support for #ifdef and #ifndef was integrated in this commit:

https://github.com/EpicGames/UnrealEngine/commit/41834919f68cea583a400437e13a68b81f04015f

Steve

avatar image Element9 May 06 '14 at 10:48 AM

Thanks for the fix and for letting me know.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question