1 /* 2 * Copyright (C) 2004-2006, Parrot Foundation. 3 */ 4 5 /* 6 7 =head1 NAME 8 9 src\platform\win32\misc.c 10 11 =head1 DESCRIPTION 12 13 Miscellaneous helper functions that are specific to Win32. 14 15 =head2 Functions 16 17 =over 4 18 19 =cut 20 21 */ 22 23 #include <ws2tcpip.h> 24 #undef CONST 25 26 #include "parrot/parrot.h" 27 28 /* HEADERIZER HFILE: none */ 29 30 /* 31 32 =item C<void Parrot_platform_init_code(void)> 33 34 Initialize Parrot for the Win32 platform. Turns off ugly crash dialog 35 boxes on Win32. 36 37 =cut 38 39 */ 40 41 void Parrot_platform_init_code(void)42Parrot_platform_init_code(void) 43 { 44 struct WSAData sockinfo; 45 int ret; 46 47 /* Start Winsock 48 * no idea where or whether destroy it 49 */ 50 ret = WSAStartup(2, &sockinfo); 51 if (ret != 0) 52 fprintf(stderr, "WSAStartup failed!!\n ErrorCode=%i\n\n", 53 WSAGetLastError()); 54 55 SetErrorMode(SEM_NOGPFAULTERRORBOX); 56 } 57 58 /* 59 60 =back 61 62 */ 63 64 /* 65 * Local variables: 66 * c-file-style: "parrot" 67 * End: 68 * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : 69 */ 70 71