[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: abstract libltdl more carefully for MinGW [libtool--devo--1.0--patc

From: Gary V. Vaughan
Subject: FYI: abstract libltdl more carefully for MinGW [libtool--devo--1.0--patch-226]
Date: Sun, 3 Oct 2004 14:51:26 +0100 (BST)
User-agent: mailnotify/0.3

Hash: SHA1

Applied to HEAD.

  * looking for address@hidden/libtool--devo--1.0--patch-225 to compare with
  * comparing to address@hidden/libtool--devo--1.0--patch-225
  M  libltdl/slist.h
  M  ChangeLog
  M  libltdl/argz_.h
  M  libltdl/lt__dirent.h
  M  libltdl/lt__alloc.h
  * modified files
  Index: Changelog
  from  Ralf Wildenhues  <address@hidden>,
        Gary V. Vaughan  <address@hidden>
        * libltdl/lt__alloc.h: Declare exported functions with LT_SCOPE
        for mingw32.
        * libltdl/lt__dirent.h: Ditto.
        * libltdl/argz._h: Ditto.  Be careful about not requiring
        additional libltdl files when used outside of libltdl.
        * libltdl/slist.h: Ditto.
        * HACKING: Add a section on libltdl implementation layering.
  --- orig/HACKING
  +++ mod/HACKING
  @@ -100,7 +100,91 @@
     variable names.  Don't use `return', instead echo the result of a
     function and call it from within backquotes.
  -6. Release Procedure
  +6. Abstraction layers in libltdl
  +* The libltdl API uses a layered approach to differentiate internal and
  +  external interfaces, among other things.  To keep the abstraction
  +  consistent, files in a given layer may only use APIs from files in the
  +  lower layers.  The exception to this is lt__glibc.h which serves a
  +  dual purpose, as explained later.
  +* At the bottom of the stack we have the system abstraction layer,
  +  which tries to smooth over the cracks where there are differences
  +  between host systems and compilers.  config.h is generated at
  +  configure time and is not installed; lt_system.h is an installed
  +  file and cannot use macros from config.h:
  +     lt_system.h     ../config.h
  +* Next up is the libc abstraction layer, which provides a uniform api
  +  to various system libc interfaces that differ between hosts supported
  +  by libtool.  Typically, the files that implement this layer begin:
  +  #if defined(HAVE_CONFIG_H)
  +  #  include HAVE_CONFIG_H
  +  #endif
  +  #include "lt_system.h"
  +  Or if they are installed headers that must work outside the libtool
  +  source tree, simply:
  +  #include <libltdl/lt_system.h>
  +  This layer's interface is defined by files that are usually named with
  +  a leading `lt__':
  +     ,------------.  ,-----------.   ,------.        ,-------.
  +     |lt__dirent.h|  |lt__alloc.h|   |argz.h|        |slist.h|
  +     +------------+  +-----------+   +------+        +-------+
  +     |lt__dirent.c|  |lt__alloc.c|   |argz.c|        |slist.c|
  +     `------------'  `-----------'   `------'        `-------'
  +  The exceptions here are argz.h and slist.h which are used
  +  independently of libltdl in other projects.
  +* There is also a sub-layer that can be used either by the headers that
  +  implement it, in which case its function is to avoid namespace clashes
  +  when linked with the GNU C library; Or it can be included by code that
  +  wants to program against a glibc like interface, where it also serves
  +  the function of pulling in all the glibc-like functionality used by
  +  libltdl from a single:
  +  #include <libltdl/lt__glibc.h>
  +  It consists of the single file:
  +     lt__glibc.h
  +* The next layer are the subsystems of the exported libltdl API, which
  +  are defined by files that are named with a leading `lt_' (no double
  +  underscore!):
  +     ,----------.    ,-------------.
  +     |lt_error.h|    |lt_dlloader.h|
  +     +----------+    +-------------+
  +     |lt_error.c|    |lt_dlloader.c|
  +     `----------'    `-------------'
  +* The top layer of the stack is the libltdl API proper, which includes
  +  the subsystems automatically:
  +     ,------.
  +     |ltdl.h|
  +     +------+
  +     |ltdl.c|
  +     `------'
  +* And finally, there is an additional internal only layer (as evidenced
  +  by the `lt__' prefix to the filename!) that defines additional
  +  internal interfaces that are not exported to libltdl clients, but are
  +  shared between internal files:
  +     lt__private.h
  +7. Release Procedure
   * If you are a libtool maintainer, but have not yet registered your
  --- orig/libltdl/argz_.h
  +++ mod/libltdl/argz_.h
  @@ -35,23 +35,30 @@
   #if defined(LTDL)
   #  include "lt__glibc.h"
  +#  define LT_SCOPE
   #if defined(_cplusplus)
   extern "C" {
  -error_t      argz_append     (char **pargz, size_t *pargz_len,
  -                      const char *buf, size_t buf_len);
  -error_t      argz_create_sep (const char *str, int delim,
  -                      char **pargz, size_t *pargz_len);
  -error_t      argz_insert     (char **pargz, size_t *pargz_len,
  -                      char *before, const char *entry);
  -char *       argz_next       (char *argz, size_t argz_len, const char 
  -void argz_stringify  (char *argz, size_t argz_len, int sep);
  +LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len,
  +                              const char *buf, size_t buf_len);
  +LT_SCOPE error_t argz_create_sep(const char *str, int delim,
  +                              char **pargz, size_t *pargz_len);
  +LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len,
  +                              char *before, const char *entry);
  +LT_SCOPE char *       argz_next      (char *argz, size_t argz_len,
  +                              const char *entry);
  +LT_SCOPE void         argz_stringify (char *argz, size_t argz_len, int sep);
   #if defined(_cplusplus)
  +#if !defined(LTDL)
  +#  undef LT_SCOPE
   #endif /*!defined(LT__ARGZ_H)*/
  --- orig/libltdl/lt__alloc.h
  +++ mod/libltdl/lt__alloc.h
  @@ -45,12 +45,12 @@
   /* If set, this function is called when memory allocation has failed.  */
   extern void (*lt__alloc_die) (void);
  -void *lt__malloc (size_t n);
  -void *lt__zalloc (size_t n);
  -void *lt__realloc (void *mem, size_t n);
  -void *lt__memdup (void const *mem, size_t n);
  +LT_SCOPE void *lt__malloc (size_t n);
  +LT_SCOPE void *lt__zalloc (size_t n);
  +LT_SCOPE void *lt__realloc (void *mem, size_t n);
  +LT_SCOPE void *lt__memdup (void const *mem, size_t n);
  -char *lt__strdup (const char *string);
  +LT_SCOPE char *lt__strdup (const char *string);
  --- orig/libltdl/lt__dirent.h
  +++ mod/libltdl/lt__dirent.h
  @@ -86,9 +86,9 @@
   } DIR;
  -DIR *                opendir         (const char *path);
  -struct dirent *      readdir         (DIR *entry);
  -void         closedir        (DIR *entry);
  +LT_SCOPE DIR *               opendir         (const char *path);
  +LT_SCOPE struct dirent *readdir              (DIR *entry);
  +LT_SCOPE void                closedir        (DIR *entry);
  --- orig/libltdl/slist.h
  +++ mod/libltdl/slist.h
  @@ -40,10 +40,15 @@
   #if !defined(SLIST_H)
   #define SLIST_H 1
  -#include <libltdl/lt_system.h>
  +#if defined(LTDL)
  +#  include <libltdl/lt_system.h>
  +#  define LT_SCOPE
  +#if defined(_cplusplus)
  +extern "C" {
   typedef struct slist {
     struct slist *next;                /* chain forward pointer*/
  @@ -76,6 +81,12 @@
   LT_SCOPE SList *slist_box    (const void *userdata);
   LT_SCOPE void *      slist_unbox     (SList *item);
  +#if defined(_cplusplus)
  +#if !defined(LTDL)
  +#  undef LT_SCOPE
   #endif /*!defined(SLIST_H)*/
- -- 
Gary V. Vaughan      ())_.  address@hidden,}
Research Scientist   ( '/
GNU Hacker           / )=
Technical Author   `(_~)_
This patch notification generated by tlaapply version 0.6
Version: GnuPG v1.2.4 (Darwin)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]