Archived Beta Discussions > SlickEdit 2015 v20 Beta Discussion

Editor confused by macros on main function definition

(1/2) > >>

(This problem also exists on SlickEdit 2012 which I normally use, but I figured I would report it here sicne I just noticed it on the beta).

For some modules, I use a wrappering macro to be able to use the same code for multiple linked objects:
#define WRAPPER(FUNC)   SomeWrapper##FUNC

static int WRAPPER(Monkey)(uint64_t uFlags, ACP_MemoryInfo *pMemoryInfo)
   Something1 = 10;
   Something2 = 11;
   Something3 = 12;
   Something4 = 13;
   Something5 = 14;

   return 0;

In this example, if you put a line before "Something1" and type "if (", the autocompletion will put the curly-braces in for you, and you can expand the section to be included using the arrow keys.

Unfortunately, hitting the down key moves the end-curly all the way past the end of the function...

Have you tried defining the WRAPPER macro within slickedit? You would do this in Tools->Options->Languages->C/C++->C/C++ Preprocessing.

SE doesn't parse your code and auto build that preprocessing list for things like this.

No I haven't tried that, but that's a lot to ask everybody working on the project to do.

I'm not sure how much it has to do with parsing the macros etc ...
If you completely cut out the function definition line, and just leave the { ... then it works as you would expect.

To share the #defines with everyone else, add them to your workspace-specific preprocessing.

Project > Workspace Properties... > C/C++ Preprocessing...

That will create a workspace_cpp.h file in the same directory as your .vpw file, and you can check that into source control.

Does the workspace also store user preferences like background color, window docking, etc?

If so, that would force everyone to use the same preferences.



[0] Message Index

[#] Next page

Go to full version