~ubuntu-branches/ubuntu/trusty/gnustep-base/trusty

« back to all changes in this revision

Viewing changes to Source/GSRunLoopWatcher.m

Tags: upstream-1.20.0
ImportĀ upstreamĀ versionĀ 1.20.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#import "config.h"
2
 
 
3
 
#import "GNUstepBase/preface.h"
 
1
/** 
 
2
   Copyright (C) 2008-2009 Free Software Foundation, Inc.
 
3
 
 
4
   By: Richard Frith-Macdonald <richard@brainstorm.co.uk>
 
5
 
 
6
   This file is part of the GNUstep Base Library.
 
7
 
 
8
   This library is free software; you can redistribute it and/or
 
9
   modify it under the terms of the GNU Lesser General Public
 
10
   License as published by the Free Software Foundation; either
 
11
   version 2 of the License, or (at your option) any later version.
 
12
 
 
13
   This library is distributed in the hope that it will be useful,
 
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
   Library General Public License for more details.
 
17
 
 
18
   You should have received a copy of the GNU Lesser General Public
 
19
   License along with this library; if not, write to the Free
 
20
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
21
   Boston, MA 02111 USA.
 
22
 
 
23
   $Date: 2009-02-23 20:42:32 +0000 (Mon, 23 Feb 2009) $ $Revision: 27962 $
 
24
*/
 
25
 
 
26
#import "common.h"
 
27
 
4
28
#import "GSRunLoopWatcher.h"
5
 
#import <Foundation/NSException.h>
6
 
#import <Foundation/NSPort.h>
 
29
#import "Foundation/NSException.h"
 
30
#import "Foundation/NSPort.h"
7
31
 
8
32
@implementation GSRunLoopWatcher
9
33
 
21
45
  data = item;
22
46
  switch (aType)
23
47
    {
24
 
#if     defined(__MINGW32__)
 
48
#if     defined(__MINGW__)
25
49
      case ET_HANDLE:   type = aType;   break;
26
50
      case ET_WINMSG:   type = aType;   break;
27
51
#else
32
56
      case ET_RPORT:    type = aType;   break;
33
57
      case ET_TRIGGER:  type = aType;   break;
34
58
      default: 
35
 
        RELEASE(self);
 
59
        DESTROY(self);
36
60
        [NSException raise: NSInvalidArgumentException
37
61
                    format: @"NSRunLoop - unknown event type"];
38
62
    }
44
68
 
45
69
  if (![anObj respondsToSelector: @selector(receivedEvent:type:extra:forMode:)])
46
70
    {
47
 
      RELEASE(self);
 
71
      DESTROY(self);
48
72
      [NSException raise: NSInvalidArgumentException
49
73
                  format: @"RunLoop listener has no event handling method"];
50
74
    }