summaryrefslogtreecommitdiff
path: root/tests/general/features.icn
blob: 2eb3f4fbcbde2ce91a12548cb3127a59309ec9e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#   Check and report configuration options
#   as reported by preprocessor symbols and &features
#
#   Compile WITHOUT using -u

global error

procedure main()
   write("Features found:")
   ckfeat(_UNIX, "UNIX")
   ckfeat(_MACINTOSH, "Macintosh")
   ckfeat(_CYGWIN, "Cygwin")
   ckfeat(_MS_WINDOWS, "MS Windows")
   ckfeat(_ASCII, "ASCII")
   ckfeat(_CO_EXPRESSIONS, "co-expressions")
   ckfeat(_DYNAMIC_LOADING, "dynamic loading")
   ckfeat(_EXTERNAL_VALUES, "external values")
   ckfeat(_KEYBOARD_FUNCTIONS, "keyboard functions")
   ckfeat(_LARGE_INTEGERS, "large integers")
   ckfeat(_PIPES, "pipes")
   ckfeat(_SYSTEM_FUNCTION, "system function")
   ckfeat(_GRAPHICS, "graphics")
   ckfeat(_X_WINDOW_SYSTEM, "X Windows")

   if \error then exit(1)
end

procedure ckfeat(ppval, fstring)
   if ppval === 1 then
      if &features == fstring then
         write("   ", fstring)
      else
         error := write("   ", fstring, " (PREPROCESSOR SYMBOL ONLY)")
   else if \ppval then
      if &features == fstring then
         error := write("   ", fstring, " (WITH BOGUS PREPROCESSOR SYMBOL: ",
            image(ppval), ")")
      else
         error := write("   ", fstring, " (ONLY BOGUS PREPROCESSOR SYMBOL: ",
            image(ppval), ")")
   else if &features == fstring then
      error := write("   ", fstring, " (WITHOUT PREPROCESSOR SYMBOL)")
   return
end