# C preprocessor for enum with macro construct

**URL:** <https://community.hex-rays.com/t/c-preprocessor-for-enum-with-macro-construct/615>\
**Category:** IDA General\
**Created:** [December 5, 2025, 8:55pm UTC](https://community.hex-rays.com/t/c-preprocessor-for-enum-with-macro-construct/615 "2025-12-05T20:55:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![revs](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@revs](https://community.hex-rays.com/u/revs)\
**Post date:** [December 5, 2025, 8:55pm UTC](https://community.hex-rays.com/t/c-preprocessor-for-enum-with-macro-construct/615/1 "2025-12-05T20:55:16Z")

</div>

is it possible add enum with macro definition?

i try “Add type”as C syntax

as

```auto
#define CURLOPT(na,t,nu) na = t + enum
#define CURLOPTTYPE_OBJECTPOINT 10000
#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
enum {

CURLOPT(CURLOPT_SSL_SIGNATURE_ALGORITHMS, CURLOPTTYPE_STRINGPOINT, 328),

}CURLOption;

```

ida say

> Successfully imported type

but enum CURLOption was not add

---

<div class="post-metadata">

**Author:** ![igor](https://sea2.discourse-cdn.com/flex002/user_avatar/community.hex-rays.com/igor/32/35_2.png) [@igor](https://community.hex-rays.com/u/igor)\
**Post date:** [December 8, 2025, 9:17am UTC](https://community.hex-rays.com/t/c-preprocessor-for-enum-with-macro-construct/615/2 "2025-12-08T09:17:21Z")

</div>

It seems you have some mistakes in your definition. The following seems to work:

```auto
#define CURLOPT(na,t,nu) na = t + nu
#define CURLOPTTYPE_OBJECTPOINT 10000
#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
enum CURLOption {

CURLOPT(CURLOPT_SSL_SIGNATURE_ALGORITHMS, CURLOPTTYPE_STRINGPOINT, 328),

};

```
