| 1 | /* |
| 2 | * End-of-run cleanup helper code used by cleanup.c. |
| 3 | * |
| 4 | * Copyright (C) 2006-2007 Wayne Davison |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along |
| 17 | * with this program; if not, visit the http://fsf.org website. |
| 18 | */ |
| 19 | |
| 20 | /* This is included by cleanup.c multiple times, once for every segement in |
| 21 | * the _exit_cleanup() code. This produces the next "case N:" statement in |
| 22 | * sequence and increments the cleanup_step variable by 1. This ensures that |
| 23 | * our case statements never get out of whack due to added/removed steps. */ |
| 24 | |
| 25 | #if !defined EXIT_CLEANUP_CASE_0 |
| 26 | #define EXIT_CLEANUP_CASE_0 |
| 27 | case 0: |
| 28 | #elif !defined EXIT_CLEANUP_CASE_1 |
| 29 | #define EXIT_CLEANUP_CASE_1 |
| 30 | case 1: |
| 31 | #elif !defined EXIT_CLEANUP_CASE_2 |
| 32 | #define EXIT_CLEANUP_CASE_2 |
| 33 | case 2: |
| 34 | #elif !defined EXIT_CLEANUP_CASE_3 |
| 35 | #define EXIT_CLEANUP_CASE_3 |
| 36 | case 3: |
| 37 | #elif !defined EXIT_CLEANUP_CASE_4 |
| 38 | #define EXIT_CLEANUP_CASE_4 |
| 39 | case 4: |
| 40 | #elif !defined EXIT_CLEANUP_CASE_5 |
| 41 | #define EXIT_CLEANUP_CASE_5 |
| 42 | case 5: |
| 43 | #elif !defined EXIT_CLEANUP_CASE_6 |
| 44 | #define EXIT_CLEANUP_CASE_6 |
| 45 | case 6: |
| 46 | #elif !defined EXIT_CLEANUP_CASE_7 |
| 47 | #define EXIT_CLEANUP_CASE_7 |
| 48 | case 7: |
| 49 | #elif !defined EXIT_CLEANUP_CASE_8 |
| 50 | #define EXIT_CLEANUP_CASE_8 |
| 51 | case 8: |
| 52 | #elif !defined EXIT_CLEANUP_CASE_9 |
| 53 | #define EXIT_CLEANUP_CASE_9 |
| 54 | case 9: |
| 55 | #elif !defined EXIT_CLEANUP_CASE_10 |
| 56 | #define EXIT_CLEANUP_CASE_10 |
| 57 | case 10: |
| 58 | #elif !defined EXIT_CLEANUP_CASE_11 |
| 59 | #define EXIT_CLEANUP_CASE_11 |
| 60 | case 11: |
| 61 | #elif !defined EXIT_CLEANUP_CASE_12 |
| 62 | #define EXIT_CLEANUP_CASE_12 |
| 63 | case 12: |
| 64 | #elif !defined EXIT_CLEANUP_CASE_13 |
| 65 | #define EXIT_CLEANUP_CASE_13 |
| 66 | case 13: |
| 67 | #elif !defined EXIT_CLEANUP_CASE_14 |
| 68 | #define EXIT_CLEANUP_CASE_14 |
| 69 | case 14: |
| 70 | #elif !defined EXIT_CLEANUP_CASE_15 |
| 71 | #define EXIT_CLEANUP_CASE_15 |
| 72 | case 15: |
| 73 | #elif !defined EXIT_CLEANUP_CASE_16 |
| 74 | #define EXIT_CLEANUP_CASE_16 |
| 75 | case 16: |
| 76 | #else |
| 77 | #error Need to add more case statements! |
| 78 | #endif |
| 79 | cleanup_step++; |