Branch: Tag:

1998-01-02

1998-01-02 01:06:47 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

lots of updates for NT, threads and new cpp

Rev: src/ChangeLog:1.128
Rev: src/Makefile.in:1.49
Rev: src/backend.c:1.20
Rev: src/configure.in:1.145
Rev: src/cpp.c:1.2
Rev: src/cpp.h:1.2
Rev: src/fd_control.c:1.11
Rev: src/fdlib.c:1.1
Rev: src/fdlib.h:1.1
Rev: src/fsort.c:1.3
Rev: src/fsort_template.h:1.2
Rev: src/lex.c:1.36
Rev: src/lex.h:1.6
Rev: src/main.c:1.29
Rev: src/modules/files/file.c:1.63
Rev: src/modules/files/socket.c:1.20
Rev: src/modules/readline/readlinemod.c:1.4
Rev: src/object.c:1.30
Rev: src/object.h:1.12
Rev: src/port.c:1.13
Rev: src/program.c:1.47
Rev: src/program.h:1.23
Rev: src/stuff.c:1.4
Rev: src/stuff.h:1.4
Rev: src/threads.c:1.48
Rev: src/threads.h:1.22
Rev: src/time_stuff.h:1.5

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: main.c,v 1.28 1997/12/28 09:29:10 hubbe Exp $"); + RCSID("$Id: main.c,v 1.29 1998/01/02 01:05:48 hubbe Exp $"); + #include "fdlib.h"   #include "backend.h"   #include "module.h"   #include "object.h"
22:   #include "dynamic_load.h"   #include "gc.h"   #include "mapping.h" + #include "cpp.h"    -  + #ifdef HAVE_WINSOCK_H + #include "winsock.h" + #endif +    #include <errno.h>      #ifdef HAVE_LOCALE_H
56:   }       - void main(int argc, char **argv, char **env) + void main(int argc, char **argv)   {    JMP_BUF back;    int e, num;
65:       ARGV=argv;    - #ifndef __NT__ -  /* Close extra fds (if any) */ -  for (e=3; e < MAX_OPEN_FILEDESCRIPTORS; e++) { -  do { -  num = close(e); -  } while ((num < 0) && (errno == EINTR)); +  fd_init(); +  + #ifdef HAVE_WINSOCK_H +  { +  WSADATA wsadata; +  if(WSAStartup(MAKEWORD(2,0), &wsadata) != 0) +  { +  fatal("No winsock available.\n");    } -  +  }   #endif      #ifdef HAVE_SETLOCALE
218:       init_shared_string_table();    init_interpreter(); +  init_cpp();    init_lex();    init_types();   
234:    }    push_array(a);    -  for(num=0;env[num];num++); +  for(num=0;environ[num];num++);    a=allocate_array_no_init(num,0); -  for(num=0;env[num];num++) +  for(num=0;environ[num];num++)    { -  ITEM(a)[num].u.string=make_shared_string(env[num]); +  ITEM(a)[num].u.string=make_shared_string(environ[num]);    ITEM(a)[num].type=T_STRING;    }    push_array(a);
294:    exit_dynamic_load();    exit_signals();    exit_lex(); +  exit_cpp();    cleanup_interpret();    cleanup_added_efuns();    cleanup_pike_types();