In the library [FreeImagePlus](http://freeimage.sourceforge.net/), in [`FreeImage.h`](http://freeimage.sourceforge.net/fip/FreeImage_8h_source.html), there is a funny `#define` which seems to create a `typedef` and an `enum` with the same name:

```
#define FI_ENUM(x)      typedef int x; enum x

```

This is expanded by the preprocessor to code like:

```
typedef int FREE_IMAGE_FILTER;
enum FREE_IMAGE_FILTER {
 FILTER_BOX = 0,
 FILTER_BICUBIC = 1,
[...]

```

What does this do? Is it even legal to have a `typedef` and an `enum` with the same name?
And isn't an `enum` compatible to `int` anyway? Why does FreeImage do this?