Building on Windows lately fails with:
Compiling util.c
util.c: In function `getDataDir':
util.c:74: error: `ret' undeclared (first use in this function)
util.c:74: error: (Each undeclared identifier is reported only once
util.c:74: error: for each function it appears in.)
mingw32-make: *** [../bin/obj/util.o] Error 1
** Build failed **
These are the lines:
#ifndef WIN32
datadir = g_strdup(DATADIR);
#else
char buf[FILENAME_MAX];
if (GetModuleFileName(NULL, buf, sizeof(buf)) != 0) {
char *p1 = strrchr(buf, '/'), *p2 = strrchr(buf, '\\');
int pos1 = (p1 != NULL) ? (int)(p1 - buf) : -1;
int pos2 = (p2 != NULL) ? (int)(p2 - buf) : -1;
int pos = MAX(pos1, pos2);
if (pos > 0)
buf[pos] = '\0';
ret = g_strdup(buf);
}
#endif
Any ideas?
N.
--
"He is no fool who gives up what he cannot keep to gain what he cannot
lose." -Jim Elliot
_______________________________________________
Bug-gnubg mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnubg