Commit 5fecd38f authored by Niels Möller's avatar Niels Möller
Browse files

*** empty log message ***

Rev: ChangeLog:1.107
Rev: src/argp/argp-comp.h:1.2
Rev: src/lsh_types.h:1.35
Rev: src/mempcpy.c:1.1
Rev: src/mempcpy.h:1.1
Rev: src/strndup.c:1.1
Rev: src/strndup.h:1.1
parent 008bb4a7
1999-10-13 Niels Mller <nisse@cuckoo.localdomain>
* src/argp/argp.h: Use PRINTF_STYLE() instead of explicit
__attribute__:s in declarations.
* src/argp/argp-parse.c (parser_init): Added cast to void * to
STORAGE macro.
(__argp_usage, __option_is_short, __option_is_end ): Replicated
definitons from argp.h.
* src/argp/argp-help.c (argp_doc): Use strndup() instead of
__strndup(). I couldn't get preprocessor hackery to work.
* src/Makefile.am.in (EXTRA_DIST): Added mempcpy.h and strndup.h.
* configure.in (gmp_header_found): Check for mempcpy and strndup.
Wed Oct 13 17:59:24 1999 Niels Mller <nisse@lysator.liu.se>
* src/argp/argp.h: #include argp-comp.h.
......
......@@ -27,9 +27,38 @@
#include "lsh_types.h"
/* Missing declarations. */
extern char *program_invocation_name;
extern char *program_invocation_short_name;
#define __THROW NORETURN
void
_argp_unlock_xxx (void);
#ifndef __THROW
#define __THROW
#endif
#if !HAVE_MEMPCPY
#include "mempcpy.h"
#endif
#if !HAVE_STRNDUP
#include "strndup.h"
#endif
#include <string.h>
#ifndef __mempcpy
#define __mempcpy mempcpy
#endif
/* For some reason, I can't get this to interact correctly with the header files on my glibc system.
* So instead, I edited the code in argp-help.c that tried to use __strndup. */
#if 0
#ifndef __strndup
#define __strndup strndup
#endif
#endif
#endif /* LSH_ARGP_COMP_H_INCLUDED */
......@@ -49,9 +49,9 @@
#define UINT8 unsigned char
#if __GNUC__ && HAVE_GCC_ATTRIBUTE
#define NORETURN __attribute__ ((noreturn))
#define PRINTF_STYLE(f, a) __attribute__ ((format(printf, f, a)))
#define UNUSED __attribute__ ((unused))
#define NORETURN __attribute__ ((__noreturn__))
#define PRINTF_STYLE(f, a) __attribute__ ((__format__ (__printf__, f, a)))
#define UNUSED __attribute__ ((__unused__))
#else
#define NORETURN
#define PRINTF_STYLE(f, a)
......
/* mempcpy.c
*
*/
#include "mempcpy.h"
void *mempcpy (void *to, const void *from, size_t size)
{
memcpy(to, from, size);
return (char *) to + size;
}
/* mempcpy.h
*
*/
#ifndef LSH_MEMPCPY_H_INCLUDED
#define LSH_MEMPCPY_H_INCLUDED
#include "lsh_types.h"
#include <string.h>
void *mempcpy (void *to, const void *from, size_t size);
#endif /* LSH_MEMPCPY_H_INCLUDED */
/* strndup.c
*
* $Id$
*/
#include "strndup.h"
char * strndup (const char *s, size_t size)
{
char *r = malloc(size);
if (size)
{
strncpy(r, s, size-1);
r[size-1] = '\0';
}
return r;
}
/* strndup.h
*
* $Id$
*/
#ifndef LSH_STRNDUP_H_INCLUDED
#define LSH_STRNDUP_H_INCLUDED
#include "lsh_types.h"
#include <string.h>
char * strndup (const char *s, size_t size);
#endif /* LSH_STRNDUP_H_INCLUDED */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment