Alexandru Ardelean 00d1e6c75e firmware-utils: fix compilation on MacOS X
Looking into /usr/include/stdlib.h, there's a `devname()` function defined
under some #ifdef's which conflicts with the `static char *devname` definition
in `src/mkwrggimg.c`.

Defining `_ANSI_SOURCE` in the `src/mkwrggimg.c` file, omits that part of the
header.

Another more intrusive approach is to rename `devname` to something like
`g_devname` in `src/mkwrggimg.c`. But I think the `_ANSI_SOURCE` define should
be enough.

Compilation error is:

    src/mkwrggimg.c:64:14: error: redefinition of 'devname' as different kind of symbol
    static char *devname;
                 ^
    /usr/include/stdlib.h:286:7: note: previous definition is here
    char    *devname(dev_t, mode_t);
             ^
    src/mkwrggimg.c:147:12: error: non-object type 'char *(dev_t, mode_t)' (aka 'char *(int, unsigned short)') is not assignable
                            devname = optarg;
                            ~~~~~~~ ^
    src/mkwrggimg.c:192:6: warning: comparison of function 'devname' equal to a null pointer is always false [-Wtautological-pointer-compare]
            if (devname == NULL) {
                ^~~~~~~    ~~~~
    src/mkwrggimg.c:192:6: note: prefix with the address-of operator to silence this warning
            if (devname == NULL) {
                ^
                &
    src/mkwrggimg.c:251:27: warning: incompatible pointer types passing 'char *(dev_t, mode_t)' (aka 'char *(int, unsigned short)') to parameter of type 'const char *' [-Wincompatible-pointer-types]
            strncpy(header->devname, devname, sizeof(header->devname));
                                     ^~~~~~~
    /usr/include/secure/_string.h:119:34: note: expanded from macro 'strncpy'
      __builtin___strncpy_chk (dest, src, len, __darwin_obsz (dest))

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
[Jo-Philipp Wich: slightly reformat commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-10-31 12:39:09 +01:00
..
2015-03-24 13:13:01 +00:00
2015-06-06 13:48:57 +00:00
2015-11-03 12:00:04 +00:00
2013-12-15 21:07:32 +00:00
2016-08-15 15:32:37 +02:00
2016-10-04 11:50:47 +02:00
2016-03-16 09:26:51 +00:00
2016-08-15 15:32:37 +02:00
2016-07-15 14:17:16 +02:00
2016-08-04 18:19:46 +02:00
2015-02-06 00:00:43 +00:00
2016-03-10 19:11:32 +00:00
2015-11-03 11:59:35 +00:00
2015-10-11 16:23:11 +00:00
2015-09-26 21:10:37 +00:00
2016-10-04 11:50:47 +02:00
2015-02-06 00:00:43 +00:00
2016-08-15 15:32:37 +02:00
2015-05-04 13:22:17 +00:00
2015-12-11 15:07:28 +00:00
2016-10-06 14:12:46 +02:00