WrapEarnPass created an issue (geany/geany#4625)

Geany has an enum 
geany/src/encodingsprivate.h
```
/* Groups of encodings */
typedef enum
{
        NONE = 0,
        WESTEUROPEAN,
        EASTEUROPEAN,
        EASTASIAN,
        ASIAN,
        MIDDLEEASTERN,
        UNICODE,

        GEANY_ENCODING_GROUPS_MAX
}
```
UNICODE in this enum conflicts with the well-known Windows UNICODE/_UNICODE 
defines.
https://learn.microsoft.com/en-us/windows/win32/learnwin32/working-with-strings

> Some headers use the preprocessor symbol UNICODE, others use _UNICODE with an 
> underscore prefix. Always define both symbols. Visual C++ sets them both by 
> default when you create a new project.

This also causes an issue with compiling with the gcc -municode flag
https://gcc.gnu.org/onlinedocs/gcc/Cygwin-and-MinGW-Options.html

```
geany/src/encodingsprivate.h:35:9: note: in expansion of macro ‘UNICODE’
   35 |         UNICODE,
      |         ^~~~~~~
```
Even if Geany does not support the -municode flag, or Windows builds with 
UNICODE defined, using a well-known define as an enum is problematic.

Prefixing the enums with G or GEANY_ seems to resolve the issue.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/4625
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/[email protected]>

Reply via email to