bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Building on Windows - `getDataDir'


From: Michael Petch
Subject: Re: [Bug-gnubg] Building on Windows - `getDataDir'
Date: Tue, 11 Aug 2009 00:13:26 -0600
User-agent: Microsoft-Entourage/12.20.0.090605


Seems like this line:

ret = g_strdup(buf);

Should be:

satadir = g_strdup(buf)

If it works I'll commit the change.

On 10/08/09 11:53 PM, "motiv4u" <address@hidden> wrote:

> 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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]