Bug #80012 Update define of __STDC_LIMIT_MACROS in my_global.h
Submitted: 16 Jan 2016 0:55 Modified: 27 Jul 2016 6:34
Reporter: Fred Battle Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S4 (Feature request)
Version:5.7.10, 5.7.13 OS:Any
Assigned to: CPU Architecture:Any

[16 Jan 2016 0:55] Fred Battle
Description:
Hi,
This is a suggestion for your source in my_global.h.

I suggest you update this line:
#define __STDC_LIMIT_MACROS

to:

#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif

This problem arises for our project when we build our MySQL client software.  We build from your source to create our Custom Storage Engine.  The conflict arises because we send to the compiler this define -D__STDC_LIMIT_MACROS.  I know your compilation instructions in my_global.h say to #include your my_global.h header file first, but that doesn't solve our conflict because we use a compiler flag which means our define is first.

Looking online at other unrelated projects, I have seen others resolve this conflict by updating their code as I suggest above.

How to repeat:
in source tarball, view mysqlcom-pro-5.7.10\include\my_global.h

Suggested fix:
note that __STDC_LIMIT_MACROS is unconditionally defined.  I think it could be more developer friendly if was conditionally defined.

#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
[27 Jul 2016 6:34] MySQL Verification Team
Hello Fred Battle,

Thank you for the feature request!

Thanks,
Umesh