1 //===-- Platform.cpp --------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // this file is only relevant for Visual C++
11 #if defined( _MSC_VER )
18 // index one of the variable arguments
19 // presuming "(EditLine *el, ..." is first in the argument list
20 #define GETARG( Y, X ) ( (void* ) *( ( (int**) &(Y) ) + (X) ) )
22 // the control handler or SIGINT handler
23 static sighandler_t _ctrlHandler = NULL;
25 // the default console control handler
27 WINAPI CtrlHandler (DWORD ctrlType)
29 if ( _ctrlHandler != NULL )
38 ioctl (int d, int request, ...)
42 // request the console windows size
45 // locate the window size structure on stack
46 winsize *ws = (winsize*) GETARG( d, 2 );
47 // get screen buffer information
48 CONSOLE_SCREEN_BUFFER_INFO info;
49 GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &info );
50 // fill in the columns
51 ws->ws_col = info.dwMaximumWindowSize.X;
57 assert( !"Not implemented!" );
63 kill (pid_t pid, int sig)
65 // is the app trying to kill itself
66 if ( pid == getpid( ) )
69 assert( !"Not implemented!" );
74 tcsetattr (int fd, int optional_actions, const struct termios *termios_p)
76 assert( !"Not implemented!" );
81 tcgetattr (int fildes, struct termios *termios_p)
83 // assert( !"Not implemented!" );
84 // error return value (0=success)
89 signal (int sig, sighandler_t sigFunc)
95 _ctrlHandler = sigFunc;
96 SetConsoleCtrlHandler( CtrlHandler, TRUE );
103 // ignore these for now
106 assert( !"Not implemented!" );