-
Notifications
You must be signed in to change notification settings - Fork 0
/
sysdeps.h
executable file
·106 lines (90 loc) · 2.13 KB
/
sysdeps.h
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
System: Structured text retrieval tool sgrep.
Module: sysdeps.h
Author: Pekka Kilpeläinen & Jani Jaakkola
Description: header file for system dependent stuff.
Version history: Original version February 1998 by JJ
Copyright: University of Helsinki, Dept. of Computer Science
Distributed under GNU General Public Lisence
See file COPYING for details
*/
#ifdef HAVE_CONFIG_H
# define HAVE_UNIX 1
#elif WIN32
# define HAVE_WIN32 1
#else
# error "No config.h provided for target and not a WIN32 system.\n Did you forget 'configure'?"
#endif
#if HAVE_WIN32
# include <io.h>
# define read _read
# define open _open
/* There is probably better place for this when using Win32-compilers,
* but this works OK */
#ifndef VERSION
# define VERSION "1.92a"
#endif
#endif
/*
* Default macro files
*/
#if HAVE_WIN32
# define USER_SGREPRC "sgreprc"
# define SYSTEM_SGREPRC "sgreprc"
#else
# define USER_SGREPRC ".sgreprc"
# define SYSTEM_SGREPRC DATADIR"/sgreprc"
#endif
/*
* Define this if you wan't sgrep to be able to exec external preprocessors
*/
#define USE_EXEC
#ifndef DEFAULT_PREPROCESSOR
# define DEFAULT_PREPROCESSOR "m4 -s"
#endif
/* #define UNIX_PREPROCESS */
/*
* If you want stream mode by default define this
*/
/* #define STREAM_MODE */
/*
* Default temp file directories
*/
#ifndef DEFAULT_TEMP_DIR
# if HAVE_WIN32
# define DEFAULT_TEMP_DIR ""
# else
# define DEFAULT_TEMP_DIR "/tmp"
# endif
#endif /* ifndef DEFAULT_TEMP_DIR */
/*
* If this is defined we try to optimize away some sort operations
*/
#define OPTIMIZE_SORTS
/*
* Sgrep has some very heavy assertion which slow sgrep down considerably.
* However, since this is a development version of sgrep, i suggest that
* you keep assertions on */
/* #define NDEBUG */
#ifdef ENABLE_ASSERTIONS
# ifdef NDEBUG
# undef NDEBUG
# endif
# if !ENABLE_ASSERTIONS
# define NDEBUG
# endif
#endif
#ifndef MEMORY_DEBUG
# define MEMORY_DEBUG 1
#endif
#ifdef SGREP_LIBRARY
# ifdef stderr
# undef stderr
# endif
# ifdef perror
# undef perror
# endif
# define stderr You_Should_Not_Use_Stderr
# define perror You_Should_Not_Use_Perror
# define exit You_Should_Not_Use_Exit
#endif