source: trunk/kStuff/kHlp/Bare/kHlpBareProcess.c@ 3594

Last change on this file since 3594 was 3594, checked in by bird, 18 years ago

Made it build on darwin - leaving a couple of things for later...

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1/* $Id: kHlpBareProcess.c 3594 2007-10-02 21:35:22Z bird $ */
2/** @file
3 * kHlpBare - Process Management
4 */
5
6/*
7 * Copyright (c) 2006-2007 knut st. osmundsen <bird-src-spam@anduin.net>
8 *
9 * This file is part of kStuff.
10 *
11 * kStuff is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * kStuff is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with kStuff; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 *
25 */
26
27/*******************************************************************************
28* Header Files *
29*******************************************************************************/
30#include <k/kHlpProcess.h>
31#include <k/kHlpAssert.h>
32
33#if K_OS == K_OS_DARWIN
34extern void kHlpSys_exit(int rc);
35
36#elif K_OS == K_OS_OS2
37# define INCL_BASE
38# define INCL_ERRORS
39# include <os2.h>
40#elif K_OS == K_OS_WINDOWS
41# include <Windows.h>
42#else
43# error "port me"
44#endif
45
46
47/**
48 * Terminate the process.
49 *
50 * @param rc The exit status.
51 */
52void kHlpExit(int rc)
53{
54 for (;;)
55 {
56#if K_OS == K_OS_DARWIN
57 kHlpSys_exit(rc);
58
59#elif K_OS == K_OS_OS2
60 DosExit(EXIT_PROCESS, rc);
61
62#elif K_OS == K_OS_WINDOWS
63 TerminateProcess(GetCurrentProcess(), rc);
64
65#else
66# error "Port me"
67#endif
68 kHlpAssert(!"Impossible");
69 }
70}
71
Note: See TracBrowser for help on using the repository browser.