Fix *nix builds

This commit is contained in:
Stas Degteff 2006-02-18 14:06:59 +00:00
parent 6920dc1246
commit 3c82e53d5f
3 changed files with 20 additions and 13 deletions

View File

@ -482,7 +482,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
FILE *pipe_in; FILE *pipe_in;
std::string pipe_buff; std::string pipe_buff;
if ((pipe_in = _popen(argbeg, "rt")) != NULL ) if ((pipe_in = popen(argbeg, "rt")) != NULL )
{ {
char buffer[1024]; char buffer[1024];
while (!feof(pipe_in)) while (!feof(pipe_in))
@ -491,7 +491,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
pipe_buff += buffer; pipe_buff += buffer;
} }
_pclose(pipe_in); pclose(pipe_in);
} }
*argend = '`'; *argend = '`';

View File

@ -101,6 +101,13 @@
#define NL "\n" #define NL "\n"
#endif #endif
/* ----------------------------------------------------------------*/
#if defined(_MSC_VER)
#define popen(f,m) _popen(f,m)
#define pclose(fh) _pclose(fh)
#endif
/* ------------------------------------------------------------------ /* ------------------------------------------------------------------
// Spellchecker using dynamic library load */ // Spellchecker using dynamic library load */
#if !defined(GCFG_NOSPELLDLL) && !defined(__WIN32__) #if !defined(GCFG_NOSPELLDLL) && !defined(__WIN32__)

View File

@ -1377,7 +1377,7 @@ gkey kbxget_raw(int mode) {
if(mode == 2) { if(mode == 2) {
int key; int key;
#ifdef __linux__ #if defined(__linux__)
// Under Linux we could use TIOCLINUX fn. 6 to read shift states on console // Under Linux we could use TIOCLINUX fn. 6 to read shift states on console
// Of course it is very unportable but should produce good results :-) // Of course it is very unportable but should produce good results :-)
key = 6; key = 6;