--- gforth/prim 2008/09/18 02:42:24 1.235 +++ gforth/prim 2008/10/15 15:27:33 1.238 @@ -1662,7 +1662,11 @@ ucols=cols; wcwidth ( u -- n ) gforth ""The number of fixed-width characters per unicode character u"" +#ifdef HAVE_WCWIDTH n = wcwidth(u); +#else +n = 1; +#endif flush-icache ( c_addr u -- ) gforth flush_icache ""Make sure that the instruction cache of the processor (if there is @@ -1929,7 +1933,7 @@ Return an error if this is not possible" wior = IOR(chdir(tilde_cstr(c_addr, u, 1))); get-dir ( c_addr1 u1 -- c_addr2 u2 ) gforth get_dir -""Store the current directory in the buffer specified by @{c-addr1, u1}. +""Store the current directory in the buffer specified by @i{c-addr1, u1}. If the buffer size is not sufficient, return 0 0"" c_addr2 = (Char *)getcwd((char *)c_addr1, u1); if(c_addr2 != NULL) { @@ -1938,6 +1942,10 @@ if(c_addr2 != NULL) { u2 = 0; } +=mkdir ( c_addr u wmode -- wior ) gforth equals_mkdir +""Create directory @i{c-addr u} with mode @i{wmode}."" +wior = IOR(mkdir(tilde_cstr(c_addr,u,1),wmode)); + \+ newline ( -- c_addr u ) gforth @@ -2403,21 +2411,7 @@ r = fp[u]; \g syslib open-lib ( c_addr1 u1 -- u2 ) gforth open_lib -#ifdef HAVE_LIBLTDL -u2 = (UCell)lt_dlopen(tilde_cstr(c_addr1, u1, 1)); -#elif defined(HAVE_LIBDL) || defined(HAVE_DLOPEN) -#ifndef RTLD_GLOBAL -#define RTLD_GLOBAL 0 -#endif -u2=(UCell) dlopen(tilde_cstr(c_addr1, u1, 1), RTLD_GLOBAL | RTLD_LAZY); -#else -# ifdef _WIN32 -u2 = (Cell) GetModuleHandle(tilde_cstr(c_addr1, u1, 1)); -# else -#warning Define open-lib! -u2 = 0; -# endif -#endif +u2 = gforth_dlopen(c_addr1, u1); lib-sym ( c_addr1 u1 u2 -- u3 ) gforth lib_sym #ifdef HAVE_LIBLTDL