Fossil SCM
Only #define fossil_pledge in config.h if FOSSIL_HAVE_PLEDGE is not defined so that makeheaders can pick up the function prototype for checkin.h when FOSSIL_HAVE_PLEDGE is defined.
Commit
1180676e9bd13b4d977d9c3274d7d0ece8a44e088a910073bc34fb30fe13e3a4
Parent
cefcc87e08cbc94…
2 files changed
+1
-3
+1
-1
+1
-3
| --- src/config.h | ||
| +++ src/config.h | ||
| @@ -259,13 +259,11 @@ | ||
| 259 | 259 | /* |
| 260 | 260 | ** The pledge() interface is currently only available on OpenBSD 5.9 |
| 261 | 261 | ** and later. Make calls to fossil_pledge() no-ops on all platforms |
| 262 | 262 | ** that omit the FOSSIL_HAVE_PLEDGE configuration parameter. |
| 263 | 263 | */ |
| 264 | -#if defined(FOSSIL_HAVE_PLEDGE) | |
| 265 | -# define fossil_pledge(A,B) fossil_pledge_impl(A,B) | |
| 266 | -#else | |
| 264 | +#if !defined(FOSSIL_HAVE_PLEDGE) | |
| 267 | 265 | # define fossil_pledge(A,B) |
| 268 | 266 | #endif |
| 269 | 267 | |
| 270 | 268 | |
| 271 | 269 | #endif /* _RC_COMPILE_ */ |
| 272 | 270 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -259,13 +259,11 @@ | |
| 259 | /* |
| 260 | ** The pledge() interface is currently only available on OpenBSD 5.9 |
| 261 | ** and later. Make calls to fossil_pledge() no-ops on all platforms |
| 262 | ** that omit the FOSSIL_HAVE_PLEDGE configuration parameter. |
| 263 | */ |
| 264 | #if defined(FOSSIL_HAVE_PLEDGE) |
| 265 | # define fossil_pledge(A,B) fossil_pledge_impl(A,B) |
| 266 | #else |
| 267 | # define fossil_pledge(A,B) |
| 268 | #endif |
| 269 | |
| 270 | |
| 271 | #endif /* _RC_COMPILE_ */ |
| 272 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -259,13 +259,11 @@ | |
| 259 | /* |
| 260 | ** The pledge() interface is currently only available on OpenBSD 5.9 |
| 261 | ** and later. Make calls to fossil_pledge() no-ops on all platforms |
| 262 | ** that omit the FOSSIL_HAVE_PLEDGE configuration parameter. |
| 263 | */ |
| 264 | #if !defined(FOSSIL_HAVE_PLEDGE) |
| 265 | # define fossil_pledge(A,B) |
| 266 | #endif |
| 267 | |
| 268 | |
| 269 | #endif /* _RC_COMPILE_ */ |
| 270 |
+1
-1
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -492,11 +492,11 @@ | ||
| 492 | 492 | ** |
| 493 | 493 | ** There is a macro in config.h that make translates calls to |
| 494 | 494 | ** "fossil_pledge(A,B)" into calls to this routine on OpenBSD. |
| 495 | 495 | ** On all other platforms, this routine does not exist. |
| 496 | 496 | */ |
| 497 | -void fossil_pledge_impl(const char *promises, const char *execpromises){ | |
| 497 | +void fossil_pledge(const char *promises, const char *execpromises){ | |
| 498 | 498 | if( pledge(promises, execpromises) ){ |
| 499 | 499 | fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d", |
| 500 | 500 | promises, execpromises, (int)errno); |
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | 503 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -492,11 +492,11 @@ | |
| 492 | ** |
| 493 | ** There is a macro in config.h that make translates calls to |
| 494 | ** "fossil_pledge(A,B)" into calls to this routine on OpenBSD. |
| 495 | ** On all other platforms, this routine does not exist. |
| 496 | */ |
| 497 | void fossil_pledge_impl(const char *promises, const char *execpromises){ |
| 498 | if( pledge(promises, execpromises) ){ |
| 499 | fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d", |
| 500 | promises, execpromises, (int)errno); |
| 501 | } |
| 502 | } |
| 503 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -492,11 +492,11 @@ | |
| 492 | ** |
| 493 | ** There is a macro in config.h that make translates calls to |
| 494 | ** "fossil_pledge(A,B)" into calls to this routine on OpenBSD. |
| 495 | ** On all other platforms, this routine does not exist. |
| 496 | */ |
| 497 | void fossil_pledge(const char *promises, const char *execpromises){ |
| 498 | if( pledge(promises, execpromises) ){ |
| 499 | fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d", |
| 500 | promises, execpromises, (int)errno); |
| 501 | } |
| 502 | } |
| 503 |