| Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 1 | define SOURCE_HELLO | 
 | 2 | #include <stdio.h> | 
 | 3 | int main(void) | 
 | 4 | { | 
 | 5 | 	return puts(\"hi\"); | 
 | 6 | } | 
 | 7 | endef | 
 | 8 |  | 
 | 9 | ifndef NO_DWARF | 
 | 10 | define SOURCE_DWARF | 
 | 11 | #include <dwarf.h> | 
| Robert Morell | a711239 | 2010-11-16 14:16:33 -0800 | [diff] [blame] | 12 | #include <elfutils/libdw.h> | 
 | 13 | #include <elfutils/version.h> | 
| Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 14 | #ifndef _ELFUTILS_PREREQ | 
 | 15 | #error | 
 | 16 | #endif | 
 | 17 |  | 
 | 18 | int main(void) | 
 | 19 | { | 
 | 20 | 	Dwarf *dbg = dwarf_begin(0, DWARF_C_READ); | 
 | 21 | 	return (long)dbg; | 
 | 22 | } | 
 | 23 | endef | 
 | 24 | endif | 
 | 25 |  | 
 | 26 | define SOURCE_LIBELF | 
 | 27 | #include <libelf.h> | 
 | 28 |  | 
 | 29 | int main(void) | 
 | 30 | { | 
 | 31 | 	Elf *elf = elf_begin(0, ELF_C_READ, 0); | 
 | 32 | 	return (long)elf; | 
 | 33 | } | 
 | 34 | endef | 
 | 35 |  | 
 | 36 | define SOURCE_GLIBC | 
 | 37 | #include <gnu/libc-version.h> | 
 | 38 |  | 
 | 39 | int main(void) | 
 | 40 | { | 
 | 41 | 	const char *version = gnu_get_libc_version(); | 
 | 42 | 	return (long)version; | 
 | 43 | } | 
 | 44 | endef | 
 | 45 |  | 
| Irina Tirdea | d816ec2 | 2012-10-08 09:43:27 +0300 | [diff] [blame] | 46 | define SOURCE_BIONIC | 
 | 47 | #include <android/api-level.h> | 
 | 48 |  | 
 | 49 | int main(void) | 
 | 50 | { | 
 | 51 | 	return __ANDROID_API__; | 
 | 52 | } | 
 | 53 | endef | 
 | 54 |  | 
| Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 55 | define SOURCE_ELF_MMAP | 
 | 56 | #include <libelf.h> | 
 | 57 | int main(void) | 
 | 58 | { | 
 | 59 | 	Elf *elf = elf_begin(0, ELF_C_READ_MMAP, 0); | 
 | 60 | 	return (long)elf; | 
 | 61 | } | 
 | 62 | endef | 
 | 63 |  | 
 | 64 | ifndef NO_NEWT | 
 | 65 | define SOURCE_NEWT | 
 | 66 | #include <newt.h> | 
 | 67 |  | 
 | 68 | int main(void) | 
 | 69 | { | 
 | 70 | 	newtInit(); | 
 | 71 | 	newtCls(); | 
 | 72 | 	return newtFinished(); | 
 | 73 | } | 
 | 74 | endef | 
 | 75 | endif | 
 | 76 |  | 
| Pekka Enberg | c31a945 | 2012-03-19 15:13:29 -0300 | [diff] [blame] | 77 | ifndef NO_GTK2 | 
 | 78 | define SOURCE_GTK2 | 
 | 79 | #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" | 
 | 80 | #include <gtk/gtk.h> | 
 | 81 | #pragma GCC diagnostic error \"-Wstrict-prototypes\" | 
 | 82 |  | 
 | 83 | int main(int argc, char *argv[]) | 
 | 84 | { | 
 | 85 |         gtk_init(&argc, &argv); | 
 | 86 |  | 
 | 87 |         return 0; | 
 | 88 | } | 
 | 89 | endef | 
| Namhyung Kim | a6b702c | 2012-05-29 13:23:01 +0900 | [diff] [blame] | 90 |  | 
 | 91 | define SOURCE_GTK2_INFOBAR | 
 | 92 | #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" | 
 | 93 | #include <gtk/gtk.h> | 
 | 94 | #pragma GCC diagnostic error \"-Wstrict-prototypes\" | 
 | 95 |  | 
 | 96 | int main(void) | 
 | 97 | { | 
 | 98 | 	gtk_info_bar_new(); | 
 | 99 |  | 
 | 100 | 	return 0; | 
 | 101 | } | 
 | 102 | endef | 
| Pekka Enberg | c31a945 | 2012-03-19 15:13:29 -0300 | [diff] [blame] | 103 | endif | 
 | 104 |  | 
| Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 105 | ifndef NO_LIBPERL | 
 | 106 | define SOURCE_PERL_EMBED | 
 | 107 | #include <EXTERN.h> | 
 | 108 | #include <perl.h> | 
 | 109 |  | 
 | 110 | int main(void) | 
 | 111 | { | 
 | 112 | perl_alloc(); | 
 | 113 | return 0; | 
 | 114 | } | 
 | 115 | endef | 
 | 116 | endif | 
 | 117 |  | 
 | 118 | ifndef NO_LIBPYTHON | 
| Michael Witten | ced465c | 2011-04-02 21:46:09 +0000 | [diff] [blame] | 119 | define SOURCE_PYTHON_VERSION | 
 | 120 | #include <Python.h> | 
 | 121 | #if PY_VERSION_HEX >= 0x03000000 | 
 | 122 | 	#error | 
 | 123 | #endif | 
| Arnaldo Carvalho de Melo | feb8ada | 2012-10-09 15:15:25 -0300 | [diff] [blame] | 124 | int main(void) | 
 | 125 | { | 
 | 126 | 	return 0; | 
 | 127 | } | 
| Michael Witten | ced465c | 2011-04-02 21:46:09 +0000 | [diff] [blame] | 128 | endef | 
| Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 129 | define SOURCE_PYTHON_EMBED | 
 | 130 | #include <Python.h> | 
| Arnaldo Carvalho de Melo | f9af3a4 | 2010-06-09 16:57:39 -0300 | [diff] [blame] | 131 | int main(void) | 
 | 132 | { | 
 | 133 | 	Py_Initialize(); | 
 | 134 | 	return 0; | 
 | 135 | } | 
 | 136 | endef | 
 | 137 | endif | 
 | 138 |  | 
 | 139 | define SOURCE_BFD | 
 | 140 | #include <bfd.h> | 
 | 141 |  | 
 | 142 | int main(void) | 
 | 143 | { | 
 | 144 | 	bfd_demangle(0, 0, 0); | 
 | 145 | 	return 0; | 
 | 146 | } | 
 | 147 | endef | 
 | 148 |  | 
 | 149 | define SOURCE_CPLUS_DEMANGLE | 
 | 150 | extern char *cplus_demangle(const char *, int); | 
 | 151 |  | 
 | 152 | int main(void) | 
 | 153 | { | 
 | 154 | 	cplus_demangle(0, 0); | 
 | 155 | 	return 0; | 
 | 156 | } | 
 | 157 | endef | 
 | 158 |  | 
| Kirill A. Shutemov | f4e7ac0 | 2010-08-21 03:38:20 +0300 | [diff] [blame] | 159 | define SOURCE_STRLCPY | 
 | 160 | #include <stdlib.h> | 
 | 161 | extern size_t strlcpy(char *dest, const char *src, size_t size); | 
 | 162 |  | 
 | 163 | int main(void) | 
 | 164 | { | 
 | 165 | 	strlcpy(NULL, NULL, 0); | 
 | 166 | 	return 0; | 
 | 167 | } | 
 | 168 | endef | 
| Jiri Olsa | 6a40cd9 | 2012-08-07 15:20:44 +0200 | [diff] [blame] | 169 |  | 
 | 170 | ifndef NO_LIBUNWIND | 
 | 171 | define SOURCE_LIBUNWIND | 
 | 172 | #include <libunwind.h> | 
 | 173 | #include <stdlib.h> | 
 | 174 |  | 
 | 175 | extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as, | 
 | 176 |                                       unw_word_t ip, | 
 | 177 |                                       unw_dyn_info_t *di, | 
 | 178 |                                       unw_proc_info_t *pi, | 
 | 179 |                                       int need_unwind_info, void *arg); | 
 | 180 |  | 
 | 181 |  | 
 | 182 | #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table) | 
 | 183 |  | 
 | 184 | int main(void) | 
 | 185 | { | 
 | 186 | 	unw_addr_space_t addr_space; | 
 | 187 | 	addr_space = unw_create_addr_space(NULL, 0); | 
 | 188 | 	unw_init_remote(NULL, addr_space, NULL); | 
 | 189 | 	dwarf_search_unwind_table(addr_space, 0, NULL, NULL, 0, NULL); | 
 | 190 | 	return 0; | 
 | 191 | } | 
 | 192 | endef | 
 | 193 | endif | 
| Irina Tirdea | c9f08be | 2012-09-08 03:43:23 +0300 | [diff] [blame] | 194 |  | 
 | 195 | ifndef NO_BACKTRACE | 
 | 196 | define SOURCE_BACKTRACE | 
 | 197 | #include <execinfo.h> | 
 | 198 | #include <stdio.h> | 
 | 199 |  | 
 | 200 | int main(void) | 
 | 201 | { | 
 | 202 | 	backtrace(NULL, 0); | 
 | 203 | 	backtrace_symbols(NULL, 0); | 
 | 204 | 	return 0; | 
 | 205 | } | 
 | 206 | endef | 
 | 207 | endif | 
| Namhyung Kim | 4d29089 | 2012-09-27 20:23:38 +0900 | [diff] [blame] | 208 |  | 
 | 209 | ifndef NO_LIBAUDIT | 
 | 210 | define SOURCE_LIBAUDIT | 
 | 211 | #include <libaudit.h> | 
 | 212 |  | 
 | 213 | int main(void) | 
 | 214 | { | 
 | 215 | 	return audit_open(); | 
 | 216 | } | 
 | 217 | endef | 
| Bernhard Rosenkraenzer | 78da39f | 2012-10-08 09:43:26 +0300 | [diff] [blame] | 218 | endif | 
 | 219 |  | 
 | 220 | define SOURCE_ON_EXIT | 
 | 221 | #include <stdio.h> | 
 | 222 |  | 
 | 223 | int main(void) | 
 | 224 | { | 
 | 225 | 	return on_exit(NULL, NULL); | 
 | 226 | } | 
 | 227 | endef |