From c8a0ea99d9907b0b820564cb421a1088ca282302 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 2 Mar 2013 10:59:31 +0100 Subject: fix formatting --- hurd/porting/guidelines.mdwn | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'hurd/porting') diff --git a/hurd/porting/guidelines.mdwn b/hurd/porting/guidelines.mdwn index aabf0345..d28a777e 100644 --- a/hurd/porting/guidelines.mdwn +++ b/hurd/porting/guidelines.mdwn @@ -189,21 +189,21 @@ To `config.h.in`, you need to add: Then something like: - #ifndef HAVE_STRERROR - static char * - private_strerror (errnum) - int errnum; - { - extern char *sys_errlist[]; - extern int sys_nerr; - - if (errnum > 0 && errnum <= sys_nerr) - return sys_errlist[errnum]; - - return "Unknown system error"; - } - #define strerror private_strerror - #endif /* HAVE_STRERROR */ + #ifndef HAVE_STRERROR + static char * + private_strerror (errnum) + int errnum; + { + extern char *sys_errlist[]; + extern int sys_nerr; + + if (errnum > 0 && errnum <= sys_nerr) + return sys_errlist[errnum]; + + return "Unknown system error"; + } + #define strerror private_strerror + #endif /* HAVE_STRERROR */ You can for example look in the latest coreutils (the above is a simplified version of what I found there.) Patches should of course be sent to upstream maintainers, this is very useful even for systems with a working `sys_errlist[]`. @@ -214,11 +214,11 @@ Of course, if you don't care about broken systems (like MS-DOG) not supporting ` On the Hurd, `error_t` is an enumeration of the `E*` constants. However, C++ does not like `E*` integer macros being directly assigned to that enumeration. In short, replace - error_t err = EINTR; + error_t err = EINTR; by - error_t err = error_t(EINTR); + error_t err = error_t(EINTR); ## Missing `termio.h` @@ -356,7 +356,7 @@ With Python, you can use the [`errno` module](http://docs.python.org/library/err ## undefined reference to `dlopen`, `dlsym`, `dlclose` -Configure script often hardcode the library that contains dlopen & such (`-ldl'), and only for Linux. Simply add the other GNU OS cases: replace `linux*' with `linux*|gnu*|k*bsd*-gnu` +Configure script often hardcode the library that contains dlopen & such (`-ldl`), and only for Linux. Simply add the other GNU OS cases: replace `linux*` with `linux*|gnu*|k*bsd*-gnu*` ## Missing `linux/types.h`, `asm/types.h`, `linux/limits.h`, `asm/byteorder.h`, `sys/endian.h`, `asm/ioctl.h`, `asm/ioctls.h`, `linux/soundcard.h` -- cgit v1.2.3