C/C++ Preprocessing

#define MYNAMESPACEDECL(name)

namespace name {

#define MYPACKEDMACRO

__packed

#define MTYPELESS

void*

#define MYPOINTER(t)

t*

#define MYNULL

((void*)0)

#define MYENDNAMESPACE

}

Among them, the only two that are harmless are MYTYPELESS and MYNULL, because they just create name aliases for types or constants. However, the other four are troublesome and cause the entire code snippet to be unparsable unless you configure SlickEdit Core to be aware of these preprocessor macros. To do so, complete the following steps:

1.From the main menu, click Window Preferences, expand SlickEdit and click General in the tree, then double-click the File Extension Setup setting. The Extension Options dialog is displayed.

2.From the Extension drop-down list, select the C extension.

3.Click the Options button at the bottom of the dialog. The C/C++ Formatting Options dialog is dis- played.

4.Select the Other tab.

5.Click the C/C++ Preprocessing button to display the C/C++ Preprocessing dialog.

Figure 7.12. C/C++ Preprocessing Dialog

6. Click New to add new preprocessing macros. Arguments are allowed; for example, mymacro(a,b,c)

246

Page 268
Image 268
Slick V3.3 manual 12. C/C++ Preprocessing Dialog