[Lost] [Patch] Änderungen an den Headern und ihre Folgen

Kevin Wolf ·

Antoine Kaufmann schrieb:
> Index: src/include/string.h
> ===================================================================
> --- src/include/string.h	(Revision 698)
> +++ src/include/string.h	(Arbeitskopie)
> @@ -1,9 +1,7 @@
>  #ifndef _STRING_H_
>  #define _STRING_H_
> +#include <stddef.h>
>  
> -#include <types.h>
> -#include "bsdtypes.h"
> -
>  void* memcpy(void* dest, const void* src, size_t num);
>  void* memmove(void* dest, const void* src, size_t num);
>  void* memset(void* addr, int value, size_t len);
> @@ -43,5 +41,8 @@
>  
>  char* strerror(int error_code);
>  
> +int strcasecmp(const char* s1, const char* s2);
> +int strncasecmp(const char* s1, const char* s2, size_t n);
> +

Die gehören hier eigentlich nicht rein. Wenn gcc das braucht, kannst du 
meinetwegen ein #include <strings.h> machen, aber bitte nicht die 
Deklarationen duplizieren.

> Index: src/modules/lib/lost_link.c
> ===================================================================
> --- src/modules/lib/lost_link.c	(Revision 698)
> +++ src/modules/lib/lost_link.c	(Arbeitskopie)
> @@ -49,12 +49,12 @@
>   *
>   * @param target_path Pfad auf den der Link zeigen soll
>   * @param link_path Pfad an dem der Link erstellt werden soll
> - * @param hardlink TRUE, falls ein Hardlink erstellt werden soll, FALSE sonst
> + * @param hardlink 1, falls ein Hardlink erstellt werden soll, 0 sonst
>   *
>   * @return 0 bei Erfolg, im Fehlerfall -1 und errno wird entsprechend gesetzt
>   */
>  int io_create_link(const char* target_path, const char* link_path,
> -    bool hardlink)
> +    int hardlink)
>  {
>      int result;
>      FILE* target_file;

Welchen Sinn hat das und warum muß das in einem Patch, der Headerdateien 
wegen gcc betrifft, enthalten sein?

> Index: src/modules/lib/gui/gui.c
> ===================================================================
> --- src/modules/lib/gui/gui.c	(Revision 698)
> +++ src/modules/lib/gui/gui.c	(Arbeitskopie)
> @@ -44,6 +44,7 @@
>  #include "rpc.h"
>  #include "init.h"
>  #include "stdlib.h"
> +#include "syscall.h"

#include <syscall.h> (mehrfach)

> Index: src/modules/c/shell/cmds/ln.c
> ===================================================================
> --- src/modules/c/shell/cmds/ln.c	(Revision 698)
> +++ src/modules/c/shell/cmds/ln.c	(Arbeitskopie)
> @@ -55,7 +55,7 @@
>          return -1;
>      }
>      
> -    int result = io_create_link(argv[1], argv[2], TRUE);
> +    int result = io_create_link(argv[1], argv[2], 1);

Siehe oben.

> +#ifndef _STDDEF_H_
> +#define _STDDEF_H_
> +#include <cdefs.h>
> +
> +#define NULL (void*) 0
> +
> +typedef __SIZE_TYPE__       size_t;
> +typedef int                 ptrdiff_t;
> +typedef short               wchar_t;

Ich möchte mein offsetof zurück. ;-)

Ansonsten sind es relativ offensichtliche Fixes.

Antworten