| 1 | function except() { |
| 2 | echo " |
| 3 | %exception $1 { |
| 4 | \$action |
| 5 | if (result < 0) { |
| 6 | PyErr_SetFromErrno(PyExc_OSError); |
| 7 | SWIG_fail; |
| 8 | } |
| 9 | } |
| 10 | " |
| 11 | } |
| 12 | if ! ${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h |
| 13 | then |
| 14 | # clang does not support -aux-info so fall back to gcc |
| 15 | gcc -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h |
| 16 | fi |
| 17 | for i in `awk '/extern int/ { print $6 }' temp.aux`; do except $i ; done |
| 18 | rm -f -- temp.aux -.o |