Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Parsing preprocessor namespace

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
jeevcat Posted - Sep 12 2018 : 4:23:09 PM
I'm using the C++ bindings for Vulkan (https://github.com/KhronosGroup/Vulkan-Hpp). Unfortunately, most of the API is not correctly parsed by Visual Assist due to a define which they use for the API's namespace.
The namespace (default: vk) is defined as follows:

#if !defined(VULKAN_HPP_NAMESPACE)
#define VULKAN_HPP_NAMESPACE vk
#endif

namespace VULKAN_HPP_NAMESPACE
{

Anything which uses the vk:: namespace fails to be parsed. I tried adding a custom define to a va_stdafx.h file,
#define vk VULKAN_HPP_NAMESPACE

but this didn't seem to work. I'm not sure if this is the correct approach at all... Any help would be greatly appreciated!
6   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Sep 14 2018 : 11:17:40 AM
Which IDE and version of VA are you using?

When you are changing tabs, how are you doing so?
How large is the other file, that you are moving into?

I have downloaded the Vulkan code, and I am not seeing this delay when moving between the vulkan.hpp file and a small cpp file. This is using VS2015 and VA 2283.2. It is possible that my test is not right, but if the file size alone was the trigger then I would expect to see something happening here.
jeevcat Posted - Sep 14 2018 : 05:08:09 AM
I've just tried this define now, and it doesn't seem to work for me. I'm not sure why. But I'm happy to just edit the header of the library for now.

On an related note (not sure if I should make a new thread for this), the editor hangs for a couple of seconds every time I switch between the tab with the vulkan.hpp header (~45,000 LOC) and any other tab in my project. Is there anything I can do to force VA not to re-parse the file each time (or whatever else it seems to be doing for a few seconds)?
accord Posted - Sep 13 2018 : 3:59:50 PM
Actually, Sean has pointed out a workaround and it seems to work for me.

#define VULKAN_HPP_NAMESPACE vk

You already tried this but I didn't notice that in your example the two word after #define were swapped. The order for #define and typedef is different.
accord Posted - Sep 13 2018 : 2:50:07 PM
Yes, I would hoped for a better workaround, but I didn't find one. This is what I can offer until the fix which should solve this.
jeevcat Posted - Sep 13 2018 : 11:42:53 AM
Yes this did work. I guess I was hoping for some solution which didn't require editing the library, but that's really more of a idealistic issue than a practical one. Thanks for the help.
accord Posted - Sep 12 2018 : 10:26:16 PM
Creating a namespace using a macro as its name causes troubles. Unfortunately, this is a know problem:

case=60804

The only workaround I can think as of now, is to change the API's file directly and replace the macro with the name:

namespace vk
{


This may improve the situation. Although I don't know whether changing this file is possible and whether this causes more problems that is solves. It worth a try.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000