poke-devel
[Top][All Lists]
Advanced

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

[PATCH] libpoke: Make all symbols hidden by default


From: Mohammad-Reza Nabipoor
Subject: [PATCH] libpoke: Make all symbols hidden by default
Date: Mon, 26 Oct 2020 23:33:46 +0330

2020-10-26  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>

        * bootstrap.conf: Add `lib-symbol-visibility` module to `libpoke`.
        * libpoke/Makefile.am: Add CPP flags to hide symbols by default.
        * libpoke/libpoke.h: Define `LIBPOKE_API` macro. Mark all public
        functions with `LIBPOKE_API`.
        * libpoke/ios.h: Remove `__attribute__ ((visibility ("hidden")))`.
        * libpoke/pkl-asm.h: Likewise.
        * libpoke/pkl-ast.h: Likewise.
        * libpoke/pkl-diag.h: Likewise.
        * libpoke/pkl-env.h: Likewise.
        * libpoke/pkl-parser.h: Likewise.
        * libpoke/pkl-pass.h: Likewise.
        * libpoke/pkl.h: Likewise.
        * libpoke/pkl-alloc.h: Likewise.
        * libpoke/pvm-program.h: Likewise.
        * libpoke/pvm-val.h: Likewise.
        * libpoke/pvm.h: Likewise.
        * etc/libpoke-public-functions: New file. Name of all public functions
        of `libpoke` per line.
        * DEV-NEWS: Add relevant notes for devs.
---

Hi.

Please apply this patch and make sure everything is fine.
There are 103 public functions in `libpoke` (`pk_*`).
I've counted them using `clang-query` in `libpoke/libpoke.h` file.

```bash
cd build
make
readelf -DsW libpoke/.libs/libpoke.so.0.0.0 \
| awk '$8 ~ /^pk_/ {print $8}' \
| sort >/tmp/libpoke-public-functions
diff ../etc/libpoke-public-functions /tmp/libpoke-public-functions >/dev/null \
&& {
  echo OK
} \
|| {
  echo NOK
}
```

There's one open question here:
  How to verify the public functions in `libpoke.so` against the
  `etc/libpoke-public-functions`?

Solution 1. Using a shell script that uses `readelf`, `awk`, `sort` and `diff`.
Solution 2. Use `poke` and `elf` pickle.


Regards,
Mohammad-Reza


 ChangeLog                    |  22 ++++
 DEV-NEWS                     |   5 +
 bootstrap.conf               |   1 +
 etc/libpoke-public-functions | 103 +++++++++++++++
 libpoke/Makefile.am          |   4 +-
 libpoke/ios.h                |  79 ++++--------
 libpoke/libpoke.h            | 224 +++++++++++++++++----------------
 libpoke/pkl-asm.h            |  72 ++++-------
 libpoke/pkl-ast.h            | 225 +++++++++++----------------------
 libpoke/pkl-diag.h           |   9 +-
 libpoke/pkl-env.h            |  39 ++----
 libpoke/pkl-parser.h         |   6 +-
 libpoke/pkl-pass.h           |   6 +-
 libpoke/pkl.h                |  72 ++++-------
 libpoke/pvm-alloc.h          |  27 ++--
 libpoke/pvm-program.h        |   6 +-
 libpoke/pvm-val.h            |   6 +-
 libpoke/pvm.h                | 237 ++++++++++++-----------------------
 18 files changed, 513 insertions(+), 630 deletions(-)
 create mode 100644 etc/libpoke-public-functions

diff --git a/ChangeLog b/ChangeLog
index f8c9d414..db629efd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2020-10-26  Mohammad-Reza Nabipoor  <m.nabipoor@yahoo.com>
+
+       * bootstrap.conf: Add `lib-symbol-visibility` module to `libpoke`.
+       * libpoke/Makefile.am: Add CPP flags to hide symbols by default.
+       * libpoke/libpoke.h: Define `LIBPOKE_API` macro. Mark all public
+       functions with `LIBPOKE_API`.
+       * libpoke/ios.h: Remove `__attribute__ ((visibility ("hidden")))`.
+       * libpoke/pkl-asm.h: Likewise.
+       * libpoke/pkl-ast.h: Likewise.
+       * libpoke/pkl-diag.h: Likewise.
+       * libpoke/pkl-env.h: Likewise.
+       * libpoke/pkl-parser.h: Likewise.
+       * libpoke/pkl-pass.h: Likewise.
+       * libpoke/pkl.h: Likewise.
+       * libpoke/pkl-alloc.h: Likewise.
+       * libpoke/pvm-program.h: Likewise.
+       * libpoke/pvm-val.h: Likewise.
+       * libpoke/pvm.h: Likewise.
+       * etc/libpoke-public-functions: New file. Name of all public functions
+       of `libpoke` per line.
+       * DEV-NEWS: Add relevant notes for devs.
+
 2020-10-25  Jose E. Marchesi  <jemarch@gnu.org>
 
        * DEV-NEWS: New file.
diff --git a/DEV-NEWS b/DEV-NEWS
index 709ccc0e..ed9c5dfd 100644
--- a/DEV-NEWS
+++ b/DEV-NEWS
@@ -7,3 +7,8 @@ poke.
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.
 
+2020-10-26
+       * libpoke: Make all symbols hidden by default.
+       * etc/libpoke-public-functions: Sorted list of all public functions of
+       `libpoke`. Update this file if you add/remove an API function (in
+       `libpoke/libpoke.h` header file).
diff --git a/bootstrap.conf b/bootstrap.conf
index 3dde1c04..f9ba0e03 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -81,6 +81,7 @@ libpoke_modules="
   vasprintf-posix
   xalloc
   strstr
+  lib-symbol-visibility
   "
 
 # gnulib modules used in gui/
diff --git a/etc/libpoke-public-functions b/etc/libpoke-public-functions
new file mode 100644
index 00000000..96cd4473
--- /dev/null
+++ b/etc/libpoke-public-functions
@@ -0,0 +1,103 @@
+pk_allocate_struct_attrs
+pk_array_elem_boffset
+pk_array_elem_val
+pk_array_nelem
+pk_array_set_elem_boffset
+pk_array_set_elem_val
+pk_array_type_bound
+pk_array_type_etype
+pk_call
+pk_compile_buffer
+pk_compile_expression
+pk_compile_file
+pk_compiler_free
+pk_compiler_new
+pk_compile_statement
+pk_completion_function
+pk_decl_map
+pk_decl_p
+pk_decl_val
+pk_defvar
+pk_disassemble_expression
+pk_disassemble_function
+pk_endian
+pk_error_on_warning
+pk_integral_type_signed_p
+pk_integral_type_size
+pk_int_size
+pk_int_value
+pk_ios_close
+pk_ios_completion_function
+pk_ios_cur
+pk_ios_flags
+pk_ios_get_dev_if_name
+pk_ios_get_id
+pk_ios_handler
+pk_ios_map
+pk_ios_open
+pk_ios_search
+pk_ios_search_by_id
+pk_ios_set_cur
+pk_ios_size
+pk_load
+pk_make_any_type
+pk_make_array
+pk_make_array_type
+pk_make_int
+pk_make_integral_type
+pk_make_offset
+pk_make_offset_type
+pk_make_string
+pk_make_string_type
+pk_make_struct
+pk_make_struct_type
+pk_make_uint
+pk_nenc
+pk_oacutoff
+pk_obase
+pk_odepth
+pk_offset_magnitude
+pk_offset_type_base_type
+pk_offset_type_unit
+pk_offset_unit
+pk_oindent
+pk_omaps
+pk_omode
+pk_pretty_print
+pk_print_val
+pk_set_alien_token_fn
+pk_set_endian
+pk_set_error_on_warning
+pk_set_lexical_cuckolding_p
+pk_set_nenc
+pk_set_oacutoff
+pk_set_obase
+pk_set_odepth
+pk_set_oindent
+pk_set_omaps
+pk_set_omode
+pk_set_pretty_print
+pk_set_quiet_p
+pk_string_str
+pk_struct_field_boffset
+pk_struct_field_name
+pk_struct_field_value
+pk_struct_nfields
+pk_struct_set_field_boffset
+pk_struct_set_field_name
+pk_struct_set_field_value
+pk_struct_type
+pk_struct_type_fname
+pk_struct_type_ftype
+pk_struct_type_name
+pk_struct_type_nfields
+pk_struct_type_set_fname
+pk_struct_type_set_ftype
+pk_type_code
+pk_typeof
+pk_uint_size
+pk_uint_value
+pk_val_equal_p
+pk_val_ios
+pk_val_mapped_p
+pk_val_offset
diff --git a/libpoke/Makefile.am b/libpoke/Makefile.am
index 51abef3a..e982994a 100644
--- a/libpoke/Makefile.am
+++ b/libpoke/Makefile.am
@@ -94,7 +94,9 @@ libpoke_la_CPPFLAGS = -I$(top_builddir)/gl-libpoke 
-I$(top_srcdir)/gl-libpoke \
                       -DPKL_DEBUG \
                       -DPKGDATADIR=\"$(pkgdatadir)\" \
                       -DPKGINFODIR=\"$(infodir)\" \
-                      -DLOCALEDIR=\"$(localedir)\"
+                      -DLOCALEDIR=\"$(localedir)\" \
+                      $(CFLAG_VISIBILITY) \
+                      -DBUILDING_LIBPOKE
 libpoke_la_CFLAGS = -Wall $(BDW_GC_CFLAGS) $(LIBNBD_CFLAGS)
 libpoke_la_LIBADD = ../gl-libpoke/libgnu.la libpvmjitter.la \
                     $(BDW_GC_LIBS) \
diff --git a/libpoke/ios.h b/libpoke/ios.h
index 2f5973bf..0e57ac6f 100644
--- a/libpoke/ios.h
+++ b/libpoke/ios.h
@@ -26,11 +26,9 @@
 /* The following two functions intialize and shutdown the IO poke
    subsystem.  */
 
-void ios_init (void)
-  __attribute__ ((visibility ("hidden")));
+void ios_init (void);
 
-void ios_shutdown (void)
-    __attribute__ ((visibility ("hidden")));
+void ios_shutdown (void);
 
 /* "IO spaces" are the entities used in poke in order to abstract the
    heterogeneous devices that are suitable to be edited, such as
@@ -149,89 +147,74 @@ typedef int64_t ios_off;
    If no IOS_F_READ or IOS_F_WRITE flags are specified, then the IOS
    will be opened in whatever mode makes more sense.  */
 
-int ios_open (const char *handler, uint64_t flags, int set_cur)
-  __attribute__ ((visibility ("hidden")));
+int ios_open (const char *handler, uint64_t flags, int set_cur);
 
 /* Close the given IO space, freing all used resources and flushing
    the space cache associated with the space.  */
 
-void ios_close (ios io)
-  __attribute__ ((visibility ("hidden")));
+void ios_close (ios io);
 
 /* Return the flags which are active in a given IO.  Note that this
    doesn't necessarily correspond to the flags passed when opening the
    IO space: some IOD backends modify them.  */
 
-uint64_t ios_flags (ios io)
-  __attribute__ ((visibility ("hidden")));
+uint64_t ios_flags (ios io);
 
 /* The following function returns the handler operated by the given IO
    space.  */
 
-const char *ios_handler (ios io)
-  __attribute__ ((visibility ("hidden")));
+const char *ios_handler (ios io);
 
 /* Return the current IO space, or NULL if there are no open
    spaces.  */
 
-ios ios_cur (void)
-  __attribute__ ((visibility ("hidden")));
+ios ios_cur (void);
 
 /* Set the current IO space to IO.  */
 
-void ios_set_cur (ios io)
-  __attribute__ ((visibility ("hidden")));
+void ios_set_cur (ios io);
 
 /* Return the IO space operating the given HANDLER.  Return NULL if no
    such space exists.  */
 
-ios ios_search (const char *handler)
-  __attribute__ ((visibility ("hidden")));
+ios ios_search (const char *handler);
 
 /* Return the IO space having the given ID.  Return NULL if no such
    space exists.  */
 
-ios ios_search_by_id (int id)
-  __attribute__ ((visibility ("hidden")));
+ios ios_search_by_id (int id);
 
 /* Return the ID of the given IO space.  */
 
-int ios_get_id (ios io)
-  __attribute__ ((visibility ("hidden")));
+int ios_get_id (ios io);
 
 /* Return the name of the device interface.  */
 
-char *ios_get_dev_if_name (ios io)
-  __attribute__ ((visibility ("hidden")));
+char *ios_get_dev_if_name (ios io);
 
 /* Return the first IO space.  */
 
-ios ios_begin (void)
-  __attribute__ ((visibility ("hidden")));
+ios ios_begin (void);
 
 /* Return the space following IO.  */
 
-ios ios_next (const ios io)
-  __attribute__ ((visibility ("hidden")));
+ios ios_next (const ios io);
 
 /* Return true iff IO is past the last one.  */
 
-bool ios_end (const ios io)
-  __attribute__ ((visibility ("hidden")));
+bool ios_end (const ios io);
 
 /* Map over all the open IO spaces executing a handler.  */
 
 typedef void (*ios_map_fn) (ios io, void *data);
 
-void ios_map (ios_map_fn cb, void *data)
-  __attribute__ ((visibility ("hidden")));
+void ios_map (ios_map_fn cb, void *data);
 
 /* **************** IOS properties************************  */
 
 /* Return the size of the given IO, in bits.  */
 
-uint64_t ios_size (ios io)
-  __attribute__ ((visibility ("hidden")));
+uint64_t ios_size (ios io);
 
 /* The IOS bias is added to every offset used in a read/write
    operation.  It is signed and measured in bits.  By default it is
@@ -240,11 +223,9 @@ uint64_t ios_size (ios io)
    The following functions set and get the bias of a given IO
    space.  */
 
-ios_off ios_get_bias (ios io)
-  __attribute__ ((visibility ("hidden")));
+ios_off ios_get_bias (ios io);
 
-void ios_set_bias (ios io, ios_off bias)
-  __attribute__ ((visibility ("hidden")));
+void ios_set_bias (ios io, ios_off bias);
 
 /* **************** Object read/write API ****************  */
 
@@ -304,8 +285,7 @@ int ios_read_int (ios io, ios_off offset, int flags,
                   int bits,
                   enum ios_endian endian,
                   enum ios_nenc nenc,
-                  int64_t *value)
-  __attribute__ ((visibility ("hidden")));
+                  int64_t *value);
 
 /* Read an unsigned integer of size BITS located at the given OFFSET,
    and put its value in VALUE.  It is assumed the integer is encoded
@@ -314,15 +294,13 @@ int ios_read_int (ios io, ios_off offset, int flags,
 int ios_read_uint (ios io, ios_off offset, int flags,
                    int bits,
                    enum ios_endian endian,
-                   uint64_t *value)
-  __attribute__ ((visibility ("hidden")));
+                   uint64_t *value);
 
 /* Read a NULL-terminated string of bytes located at the given OFFSET,
    and put its value in VALUE.  It is up to the caller to free the
    memory occupied by the returned string, when no longer needed.  */
 
-int ios_read_string (ios io, ios_off offset, int flags, char **value)
-  __attribute__ ((visibility ("hidden")));
+int ios_read_string (ios io, ios_off offset, int flags, char **value);
 
 /* Write the signed integer of size BITS in VALUE to the space IO, at
    the given OFFSET.  Use the byte endianness ENDIAN and encoding NENC
@@ -332,8 +310,7 @@ int ios_write_int (ios io, ios_off offset, int flags,
                    int bits,
                    enum ios_endian endian,
                    enum ios_nenc nenc,
-                   int64_t value)
-  __attribute__ ((visibility ("hidden")));
+                   int64_t value);
 
 /* Write the unsigned integer of size BITS in VALUE to the space IO,
    at the given OFFSET.  Use the byte endianness ENDIAN when writing
@@ -342,23 +319,19 @@ int ios_write_int (ios io, ios_off offset, int flags,
 int ios_write_uint (ios io, ios_off offset, int flags,
                     int bits,
                     enum ios_endian endian,
-                    uint64_t value)
-  __attribute__ ((visibility ("hidden")));
+                    uint64_t value);
 
 /* Write the NULL-terminated string in VALUE to the space IO, at the
    given OFFSET.  */
 
-int ios_write_string (ios io, ios_off offset, int flags,
-                      const char *value)
-  __attribute__ ((visibility ("hidden")));
+int ios_write_string (ios io, ios_off offset, int flags, const char *value);
 
 /* If the current IOD is a write stream, write out the data in the buffer
    till OFFSET.  If the current IOD is a stream IOD, free (if allowed by the
    embedded buffering strategy) bytes up to OFFSET.  This function has no
    impact when called on other IO devices.  */
 
-int ios_flush (ios io, ios_off offset)
-  __attribute__ ((visibility ("hidden")));
+int ios_flush (ios io, ios_off offset);
 
 /* **************** Update API **************** */
 
diff --git a/libpoke/libpoke.h b/libpoke/libpoke.h
index f3b20a38..f5a90947 100644
--- a/libpoke/libpoke.h
+++ b/libpoke/libpoke.h
@@ -24,6 +24,12 @@
 #include <stdint.h>
 #include <stdarg.h>
 
+#if defined BUILDING_LIBPOKE && HAVE_VISIBILITY
+#define LIBPOKE_API __attribute__ ((visibility ("default")))
+#else
+#define LIBPOKE_API
+#endif
+
 typedef struct pk_compiler *pk_compiler;
 typedef struct pk_ios *pk_ios;
 typedef uint64_t pk_val;
@@ -78,13 +84,13 @@ struct pk_term_if
    NULL.  */
 
 pk_compiler pk_compiler_new (const char *rtpath,
-                             struct pk_term_if *term_if);
+                             struct pk_term_if *term_if) LIBPOKE_API;
 
 /* Destroy an instance of a Poke incremental compiler.
 
    PKC is a previously created incremental compiler.  */
 
-void pk_compiler_free (pk_compiler pkc);
+void pk_compiler_free (pk_compiler pkc) LIBPOKE_API;
 
 /* Compile a Poke program from the given file FILENAME.
 
@@ -95,7 +101,7 @@ void pk_compiler_free (pk_compiler pkc);
    otherwise.  */
 
 int pk_compile_file (pk_compiler pkc, const char *filename,
-                     int *exit_status);
+                     int *exit_status) LIBPOKE_API;
 
 /* Compile a Poke program from a memory buffer.
 
@@ -108,7 +114,7 @@ int pk_compile_file (pk_compiler pkc, const char *filename,
    otherwise.  */
 
 int pk_compile_buffer (pk_compiler pkc, const char *buffer,
-                       const char **end);
+                       const char **end) LIBPOKE_API;
 
 /* Like pk_compile_buffer but compile and execute a single Poke
    statement, which may evaluate to a value if it is an "expression
@@ -118,7 +124,7 @@ int pk_compile_buffer (pk_compiler pkc, const char *buffer,
    result value of an expression-statement, or to PK_NULL.  */
 
 int pk_compile_statement (pk_compiler pkc, const char *buffer,
-                          const char **end, pk_val *val);
+                          const char **end, pk_val *val) LIBPOKE_API;
 
 /* Like pk_compile_buffer but compile and execute a single Poke
    expression, which evaluates to a value.
@@ -127,14 +133,14 @@ int pk_compile_statement (pk_compiler pkc, const char 
*buffer,
    result value of executing the expression.  */
 
 int pk_compile_expression (pk_compiler pkc, const char *buffer,
-                           const char **end, pk_val *val);
+                           const char **end, pk_val *val) LIBPOKE_API;
 
 /* Load a module using the given compiler.
 
    If the module cannot be loaded, return 1.
    Otherwise, return 0.  */
 
-int pk_load (pk_compiler pkc, const char *module);
+int pk_load (pk_compiler pkc, const char *module) LIBPOKE_API;
 
 /* Print a disassembly of a function.
 
@@ -148,7 +154,7 @@ int pk_load (pk_compiler pkc, const char *module);
    return PK_OK.  */
 
 int pk_disassemble_function (pk_compiler pkc, const char *fname,
-                             int native_p);
+                             int native_p) LIBPOKE_API;
 
 /* Print a disassembly of an expression.
 
@@ -161,12 +167,12 @@ int pk_disassemble_function (pk_compiler pkc, const char 
*fname,
    return PK_OK.  */
 
 int pk_disassemble_expression (pk_compiler pkc, const char *str,
-                               int native_p);
+                               int native_p) LIBPOKE_API;
 
 /* Set the QUIET_P flag in the compiler.  If this flag is set, the
    incremental compiler emits as few output as possible.  */
 
-void pk_set_quiet_p (pk_compiler pkc, int quiet_p);
+void pk_set_quiet_p (pk_compiler pkc, int quiet_p) LIBPOKE_API;
 
 /* Install a handler for alien tokens in the incremental compiler.
    The handler gets a string with the token identifier (for $foo it
@@ -177,7 +183,8 @@ void pk_set_quiet_p (pk_compiler pkc, int quiet_p);
 
 typedef char *(*pk_alien_token_handler_fn) (const char *id,
                                             char **errmsg);
-void pk_set_alien_token_fn (pk_compiler pkc, pk_alien_token_handler_fn cb);
+void pk_set_alien_token_fn (pk_compiler pkc,
+                            pk_alien_token_handler_fn cb) LIBPOKE_API;
 
 /* Set the LEXICAL_CUCKOLDING_P flag in the compiler.  If this flag is
    set, alien tokens are recognized and processed by calling the
@@ -187,7 +194,7 @@ void pk_set_alien_token_fn (pk_compiler pkc, 
pk_alien_token_handler_fn cb);
    handler for alien tokens.  */
 
 void pk_set_lexical_cuckolding_p (pk_compiler pkc,
-                                  int lexical_cuckolding_p);
+                                  int lexical_cuckolding_p) LIBPOKE_API;
 
 /* Complete the name of a variable, function or type declared in the
    global environment of the given icnremental compiler.
@@ -204,7 +211,7 @@ void pk_set_lexical_cuckolding_p (pk_compiler pkc,
    left. */
 
 char *pk_completion_function (pk_compiler pkc,
-                              const char *text, int state);
+                              const char *text, int state) LIBPOKE_API;
 
 /* Complete the tag of an IOS.
 
@@ -216,42 +223,42 @@ char *pk_completion_function (pk_compiler pkc,
    indicate that there are no more such tags.  */
 
 char *pk_ios_completion_function (pk_compiler pkc,
-                                  const char *x, int state);
+                                  const char *x, int state) LIBPOKE_API;
 
 /* Return the handler operated by the given IO space.  */
 
-const char *pk_ios_handler (pk_ios ios);
+const char *pk_ios_handler (pk_ios ios) LIBPOKE_API;
 
 /* Return the current IO space, or NULL if there are open spaces in
    the given Poke compiler.  */
 
-pk_ios pk_ios_cur (pk_compiler pkc);
+pk_ios pk_ios_cur (pk_compiler pkc) LIBPOKE_API;
 
 /* Set the current IO space in the given incremental compiler.  */
 
-void pk_ios_set_cur (pk_compiler pkc, pk_ios ios);
+void pk_ios_set_cur (pk_compiler pkc, pk_ios ios) LIBPOKE_API;
 
 /* Return the IO space operating the given HANDLER.  Return NULL if no
    such space exist in the given Poke incremental compiler.  */
 
-pk_ios pk_ios_search (pk_compiler pkc, const char *handler);
+pk_ios pk_ios_search (pk_compiler pkc, const char *handler) LIBPOKE_API;
 
 /* Return the IO space having the given ID.  Return NULL if no such
    space exist in the given Poke incremental compiler.  */
 
-pk_ios pk_ios_search_by_id (pk_compiler pkc, int id);
+pk_ios pk_ios_search_by_id (pk_compiler pkc, int id) LIBPOKE_API;
 
 /* Return the ID of the given IO space.  */
 
-int pk_ios_get_id (pk_ios ios);
+int pk_ios_get_id (pk_ios ios) LIBPOKE_API;
 
 /* Return the name of the device interface.  */
 
-char *pk_ios_get_dev_if_name (pk_ios ios);
+char *pk_ios_get_dev_if_name (pk_ios ios) LIBPOKE_API;
 
 /* Return the size of the given IO space, in bits.  */
 
-uint64_t pk_ios_size (pk_ios ios);
+uint64_t pk_ios_size (pk_ios ios) LIBPOKE_API;
 
 /* Return the flags which are active in a given IOS.  */
 
@@ -260,7 +267,7 @@ uint64_t pk_ios_size (pk_ios ios);
 #define PK_IOS_F_TRUNCATE 8
 #define PK_IOS_F_CREATE  16
 
-uint64_t pk_ios_flags (pk_ios ios);
+uint64_t pk_ios_flags (pk_ios ios) LIBPOKE_API;
 
 /* Open an IO space using a handler and if set_cur is set to 1, make
    the newly opened IO space the current space.  Return PK_IOS_ERROR
@@ -278,18 +285,18 @@ uint64_t pk_ios_flags (pk_ios ios);
 #define PK_IOS_ERROR -1
 
 int pk_ios_open (pk_compiler pkc,
-                 const char *handler, uint64_t flags, int set_cur_p);
+                 const char *handler, uint64_t flags, int set_cur_p) 
LIBPOKE_API;
 
 /* Close the given IO space, freing all used resources and flushing
    the space cache associated with the space.  */
 
-void pk_ios_close (pk_compiler pkc, pk_ios ios);
+void pk_ios_close (pk_compiler pkc, pk_ios ios) LIBPOKE_API;
 
 /* Map over all the IO spaces in a given incremental compiler,
    executing a handler.  */
 
 typedef void (*pk_ios_map_fn) (pk_ios ios, void *data);
-void pk_ios_map (pk_compiler pkc, pk_ios_map_fn cb, void *data);
+void pk_ios_map (pk_compiler pkc, pk_ios_map_fn cb, void *data) LIBPOKE_API;
 
 /* Map over the declarations defined in the given incremental
    compiler, executing a handler.
@@ -314,19 +321,19 @@ typedef void (*pk_map_decl_fn) (int kind,
                                 int first_column, int last_column,
                                 void *data);
 void pk_decl_map (pk_compiler pkc, int kind,
-                  pk_map_decl_fn handler, void *data);
+                  pk_map_decl_fn handler, void *data) LIBPOKE_API;
 
 /* Determine whether there is a declaration with the given name, of
    the given type.  */
 
-int pk_decl_p (pk_compiler pkc, const char *name, int kind);
+int pk_decl_p (pk_compiler pkc, const char *name, int kind) LIBPOKE_API;
 
 /* Given the name of a variable declared in the compiler, return its
    value.
 
    If there is no variable defined with name NAME, return PK_NULL.  */
 
-pk_val pk_decl_val (pk_compiler pkc, const char *name);
+pk_val pk_decl_val (pk_compiler pkc, const char *name) LIBPOKE_API;
 
 /* Declare a variable in the global environment of the given
    incremental compiler.
@@ -334,7 +341,7 @@ pk_val pk_decl_val (pk_compiler pkc, const char *name);
    If the operation is successful, return 1.  If a variable with name
    VARNAME already exists in the environment, return 0.  */
 
-int pk_defvar (pk_compiler pkc, const char *varname, pk_val val);
+int pk_defvar (pk_compiler pkc, const char *varname, pk_val val) LIBPOKE_API;
 
 /* Call a Poke function.
 
@@ -351,24 +358,24 @@ int pk_defvar (pk_compiler pkc, const char *varname, 
pk_val val);
    Return 1 otherwise.  */
 
 int pk_call (pk_compiler pkc, pk_val cls, pk_val *ret, ...)
-  __attribute__ ((sentinel));
+  __attribute__ ((sentinel)) LIBPOKE_API;
 
 /* Get and set properties of the incremental compiler.  */
 
-int pk_obase (pk_compiler pkc);
-void pk_set_obase (pk_compiler pkc, int obase);
+int pk_obase (pk_compiler pkc) LIBPOKE_API;
+void pk_set_obase (pk_compiler pkc, int obase) LIBPOKE_API;
 
-unsigned int pk_oacutoff (pk_compiler pkc);
-void pk_set_oacutoff (pk_compiler pkc, unsigned int oacutoff);
+unsigned int pk_oacutoff (pk_compiler pkc) LIBPOKE_API;
+void pk_set_oacutoff (pk_compiler pkc, unsigned int oacutoff) LIBPOKE_API;
 
-unsigned int pk_odepth (pk_compiler pkc);
-void pk_set_odepth (pk_compiler pkc, unsigned int odepth);
+unsigned int pk_odepth (pk_compiler pkc) LIBPOKE_API;
+void pk_set_odepth (pk_compiler pkc, unsigned int odepth) LIBPOKE_API;
 
-unsigned int pk_oindent (pk_compiler pkc);
-void pk_set_oindent (pk_compiler pkc, unsigned int oindent);
+unsigned int pk_oindent (pk_compiler pkc) LIBPOKE_API;
+void pk_set_oindent (pk_compiler pkc, unsigned int oindent) LIBPOKE_API;
 
-int pk_omaps (pk_compiler pkc);
-void pk_set_omaps (pk_compiler pkc, int omaps_p);
+int pk_omaps (pk_compiler pkc) LIBPOKE_API;
+void pk_set_omaps (pk_compiler pkc, int omaps_p) LIBPOKE_API;
 
 enum pk_omode
   {
@@ -376,11 +383,12 @@ enum pk_omode
     PK_PRINT_TREE
   };
 
-enum pk_omode pk_omode (pk_compiler pkc);
-void pk_set_omode (pk_compiler pkc, enum pk_omode omode);
+enum pk_omode pk_omode (pk_compiler pkc) LIBPOKE_API;
+void pk_set_omode (pk_compiler pkc, enum pk_omode omode) LIBPOKE_API;
 
-int pk_error_on_warning (pk_compiler pkc);
-void pk_set_error_on_warning (pk_compiler pkc, int error_on_warning_p);
+int pk_error_on_warning (pk_compiler pkc) LIBPOKE_API;
+void pk_set_error_on_warning (pk_compiler pkc,
+                              int error_on_warning_p) LIBPOKE_API;
 
 enum pk_endian
   {
@@ -388,8 +396,8 @@ enum pk_endian
     PK_ENDIAN_MSB
   };
 
-enum pk_endian pk_endian (pk_compiler pkc);
-void pk_set_endian (pk_compiler pkc, enum pk_endian endian);
+enum pk_endian pk_endian (pk_compiler pkc) LIBPOKE_API;
+void pk_set_endian (pk_compiler pkc, enum pk_endian endian) LIBPOKE_API;
 
 enum pk_nenc
   {
@@ -397,11 +405,11 @@ enum pk_nenc
     PK_NENC_2
   };
 
-enum pk_nenc pk_nenc (pk_compiler pkc);
-void pk_set_nenc (pk_compiler pkc, enum pk_nenc nenc);
+enum pk_nenc pk_nenc (pk_compiler pkc) LIBPOKE_API;
+void pk_set_nenc (pk_compiler pkc, enum pk_nenc nenc) LIBPOKE_API;
 
-int pk_pretty_print (pk_compiler pkc);
-void pk_set_pretty_print (pk_compiler pkc, int pretty_print_p);
+int pk_pretty_print (pk_compiler pkc) LIBPOKE_API;
+void pk_set_pretty_print (pk_compiler pkc, int pretty_print_p) LIBPOKE_API;
 
 /*** API for manipulating Poke values.  ***/
 
@@ -420,17 +428,17 @@ void pk_set_pretty_print (pk_compiler pkc, int 
pretty_print_p);
    Return PK_NULL if SIZE exceeds the maximum number of bits supported
    in Poke integers.  */
 
-pk_val pk_make_int (int64_t value, int size);
+pk_val pk_make_int (int64_t value, int size) LIBPOKE_API;
 
 /* Return the numerical value stored in the given Poke integer.
    VAL should be a Poke value of the right type.  */
 
-int64_t pk_int_value (pk_val val);
+int64_t pk_int_value (pk_val val) LIBPOKE_API;
 
 /* Return the size (in bits) of the given Poke integer.
    VAL should be a Poke value of the right type.  */
 
-int pk_int_size (pk_val val);
+int pk_int_size (pk_val val) LIBPOKE_API;
 
 /* Unsigned integers.  */
 
@@ -442,19 +450,19 @@ int pk_int_size (pk_val val);
    Return NULL if SIZE exceeds the maximum number of bits supported in
    Poke integers.  */
 
-pk_val pk_make_uint (uint64_t value, int size);
+pk_val pk_make_uint (uint64_t value, int size) LIBPOKE_API;
 
 /* Return the numerical value stored in the given Poke unsigned
    integer.
 
    VAL should be a Poke value of the right type.  */
 
-uint64_t pk_uint_value (pk_val val);
+uint64_t pk_uint_value (pk_val val) LIBPOKE_API;
 
 /* Return the size (in bits) of the given Poke unsigned integer.
    VAL should be a Poke value of the right type.  */
 
-int pk_uint_size (pk_val val);
+int pk_uint_size (pk_val val) LIBPOKE_API;
 
 /* Strings.  */
 
@@ -463,12 +471,12 @@ int pk_uint_size (pk_val val);
    STR is a NULL-terminated string, a copy of which will become the
    value of the Poke string.  */
 
-pk_val pk_make_string (const char *str);
+pk_val pk_make_string (const char *str) LIBPOKE_API;
 
 /* Return a NULL-terminated string with the value of the given Poke
    string.  */
 
-const char *pk_string_str (pk_val val);
+const char *pk_string_str (pk_val val) LIBPOKE_API;
 
 /* Offsets.  */
 
@@ -483,15 +491,15 @@ const char *pk_string_str (pk_val val);
    If any of the arguments is not of the right type return PK_NULL.
    Otherwise return the created offset.  */
 
-pk_val pk_make_offset (pk_val magnitude, pk_val unit);
+pk_val pk_make_offset (pk_val magnitude, pk_val unit) LIBPOKE_API;
 
 /* Return the magnitude of the given Poke offset.  */
 
-pk_val pk_offset_magnitude (pk_val val);
+pk_val pk_offset_magnitude (pk_val val) LIBPOKE_API;
 
 /* Return the unit of the given Poke offset.  */
 
-pk_val pk_offset_unit (pk_val val);
+pk_val pk_offset_unit (pk_val val) LIBPOKE_API;
 
 /* Structs. */
 
@@ -505,11 +513,11 @@ pk_val pk_offset_unit (pk_val val);
    The fields and methods in the created struct are initialized to
    PK_NULL.  */
 
-pk_val pk_make_struct (pk_val nfields, pk_val type);
+pk_val pk_make_struct (pk_val nfields, pk_val type) LIBPOKE_API;
 
 /* Get the number of fields of a struct. */
 
-pk_val pk_struct_nfields (pk_val sct);
+pk_val pk_struct_nfields (pk_val sct) LIBPOKE_API;
 
 /* Get the bit-offset of the field of a struct, relative to the
    beginning of the struct.
@@ -521,7 +529,7 @@ pk_val pk_struct_nfields (pk_val sct);
 
    If IDX is invalid, PK_NULL is returned. */
 
-pk_val pk_struct_field_boffset (pk_val sct, uint64_t idx);
+pk_val pk_struct_field_boffset (pk_val sct, uint64_t idx) LIBPOKE_API;
 
 /* Set the bit-offset of the field of an struct, relative to the
    beginning of the struct.
@@ -534,7 +542,8 @@ pk_val pk_struct_field_boffset (pk_val sct, uint64_t idx);
 
    If IDX is invalid, struct remains unchanged. */
 
-void pk_struct_set_field_boffset (pk_val sct, uint64_t idx, pk_val boffset);
+void pk_struct_set_field_boffset (pk_val sct, uint64_t idx,
+                                  pk_val boffset) LIBPOKE_API;
 
 /* Get the NAME of the struct field.
 
@@ -544,7 +553,7 @@ void pk_struct_set_field_boffset (pk_val sct, uint64_t idx, 
pk_val boffset);
 
    If IDX is invalid, PK_NULL is returned. */
 
-pk_val pk_struct_field_name (pk_val sct, uint64_t idx);
+pk_val pk_struct_field_name (pk_val sct, uint64_t idx) LIBPOKE_API;
 
 /* Set the NAME of the struct field.
 
@@ -556,7 +565,8 @@ pk_val pk_struct_field_name (pk_val sct, uint64_t idx);
 
    If IDX is invalid, struct remains unchanged. */
 
-void pk_struct_set_field_name (pk_val sct, uint64_t idx, pk_val name);
+void pk_struct_set_field_name (pk_val sct, uint64_t idx,
+                               pk_val name) LIBPOKE_API;
 
 /* Get the VALUE of the struct field.
 
@@ -566,7 +576,7 @@ void pk_struct_set_field_name (pk_val sct, uint64_t idx, 
pk_val name);
 
    If IDX is invalid, PK_NULL is returned. */
 
-pk_val pk_struct_field_value (pk_val sct, uint64_t idx);
+pk_val pk_struct_field_value (pk_val sct, uint64_t idx) LIBPOKE_API;
 
 /* Set the VALUE of the struct field.
 
@@ -578,7 +588,8 @@ pk_val pk_struct_field_value (pk_val sct, uint64_t idx);
 
    If IDX is invalid, struct remains unchanged. */
 
-void pk_struct_set_field_value (pk_val sct, uint64_t idx, pk_val value);
+void pk_struct_set_field_value (pk_val sct, uint64_t idx,
+                                pk_val value) LIBPOKE_API;
 
 /* Arrays.  */
 
@@ -589,12 +600,12 @@ void pk_struct_set_field_value (pk_val sct, uint64_t idx, 
pk_val value);
 
    The new array is created containing PK_NULL values.  */
 
-pk_val pk_make_array (pk_val nelem, pk_val array_type);
+pk_val pk_make_array (pk_val nelem, pk_val array_type) LIBPOKE_API;
 
 /* Get the number of elements in the given array value, as an
    uint<64>.  */
 
-pk_val pk_array_nelem (pk_val array);
+pk_val pk_array_nelem (pk_val array) LIBPOKE_API;
 
 /* Get the value of the element of an array.
 
@@ -603,7 +614,7 @@ pk_val pk_array_nelem (pk_val array);
 
    If IDX is invalid, PK_NULL is returned. */
 
-pk_val pk_array_elem_val (pk_val array, uint64_t idx);
+pk_val pk_array_elem_val (pk_val array, uint64_t idx) LIBPOKE_API;
 
 /* Set the value of the element of an array.
 
@@ -616,7 +627,7 @@ pk_val pk_array_elem_val (pk_val array, uint64_t idx);
 
    If IDX is invalid, array remains unchanged. */
 
-void pk_array_set_elem_val (pk_val array, uint64_t idx, pk_val val);
+void pk_array_set_elem_val (pk_val array, uint64_t idx, pk_val val) 
LIBPOKE_API;
 
 /* Get the bit-offset of the element of an array, relative to the
    beginning of the array.
@@ -628,7 +639,7 @@ void pk_array_set_elem_val (pk_val array, uint64_t idx, 
pk_val val);
 
    If IDX is invalid, PK_NULL is returned. */
 
-pk_val pk_array_elem_boffset (pk_val array, uint64_t idx);
+pk_val pk_array_elem_boffset (pk_val array, uint64_t idx) LIBPOKE_API;
 
 /* Set the bit-offset of the element of an array, relative to the
    beginning of the array.
@@ -639,7 +650,8 @@ pk_val pk_array_elem_boffset (pk_val array, uint64_t idx);
 
    If IDX is invalid, array remains unchanged. */
 
-void pk_array_set_elem_boffset (pk_val array, uint64_t idx, pk_val boffset);
+void pk_array_set_elem_boffset (pk_val array, uint64_t idx,
+                                pk_val boffset) LIBPOKE_API;
 
 /* Integral types.  */
 
@@ -649,29 +661,29 @@ void pk_array_set_elem_boffset (pk_val array, uint64_t 
idx, pk_val boffset);
    SIGNED_P is an int<32> with a boolean specifying whether the type
    is signed or not.  */
 
-pk_val pk_make_integral_type (pk_val size, pk_val signed_p);
+pk_val pk_make_integral_type (pk_val size, pk_val signed_p) LIBPOKE_API;
 
 /* Return an uint<64> containing the size, in bits, of the given
    integral type.  */
 
-pk_val pk_integral_type_size (pk_val type);
+pk_val pk_integral_type_size (pk_val type) LIBPOKE_API;
 
 /* Return an int<32> with a boolean specifying whether the given
    integral type is signed or not.  */
 
-pk_val pk_integral_type_signed_p (pk_val type);
+pk_val pk_integral_type_signed_p (pk_val type) LIBPOKE_API;
 
 /* The string type.  */
 
 /* Build and return the string type.  */
 
-pk_val pk_make_string_type (void);
+pk_val pk_make_string_type (void) LIBPOKE_API;
 
 /* The `any' type.  */
 
 /* Build and return the `any' type.  */
 
-pk_val pk_make_any_type (void);
+pk_val pk_make_any_type (void) LIBPOKE_API;
 
 /* Offset types.  */
 
@@ -683,15 +695,15 @@ pk_val pk_make_any_type (void);
    UNIT is an uint<64> with the unit of the offset type.  The unit is
    a multiple of the base unit, which is the bit.  */
 
-pk_val pk_make_offset_type (pk_val base_type, pk_val unit);
+pk_val pk_make_offset_type (pk_val base_type, pk_val unit) LIBPOKE_API;
 
 /* Get the base type of a given offset type.  */
 
-pk_val pk_offset_type_base_type (pk_val type);
+pk_val pk_offset_type_base_type (pk_val type) LIBPOKE_API;
 
 /* Get the unit of a given offset type.  */
 
-pk_val pk_offset_type_unit (pk_val type);
+pk_val pk_offset_type_unit (pk_val type) LIBPOKE_API;
 
 /* Struct types. */
 
@@ -705,30 +717,29 @@ pk_val pk_offset_type_unit (pk_val type);
 
    FTYPES is a C array containing the types of each struct field. */
 
-pk_val pk_make_struct_type (pk_val nfields,
-pk_val name, pk_val *fnames,
-            pk_val *ftypes);
+pk_val pk_make_struct_type (pk_val nfields, pk_val name, pk_val *fnames,
+                            pk_val *ftypes) LIBPOKE_API;
 
 /* Get the type of a struct.  */
 
-pk_val pk_struct_type (pk_val sct);
+pk_val pk_struct_type (pk_val sct) LIBPOKE_API;
 
 /* Allocate space for struct fields names and field types. */
 
 void pk_allocate_struct_attrs (pk_val nfields,
-pk_val **fnames, pk_val **ftypes);
+pk_val **fnames, pk_val **ftypes) LIBPOKE_API;
 
 /* Get the name of a struct type.
 
    If the struct type is anonymous, PK_NULL is returned.  */
 
-pk_val pk_struct_type_name (pk_val type);
+pk_val pk_struct_type_name (pk_val type) LIBPOKE_API;
 
 /* Get the number of fields of a struct type.
 
    The returned value is an uint<64> */
 
-pk_val pk_struct_type_nfields (pk_val type);
+pk_val pk_struct_type_nfields (pk_val type) LIBPOKE_API;
 
 /* Get the name of a field in a struct type.
 
@@ -740,7 +751,7 @@ pk_val pk_struct_type_nfields (pk_val type);
 
    If the struct field is anonymous, PK_NULL is returned.  */
 
-pk_val pk_struct_type_fname (pk_val type, uint64_t idx);
+pk_val pk_struct_type_fname (pk_val type, uint64_t idx) LIBPOKE_API;
 
 /* Set the name of a field of a struct type.
 
@@ -752,7 +763,8 @@ pk_val pk_struct_type_fname (pk_val type, uint64_t idx);
 
    If IDX is invalid, type remains unchanged.  */
 
-void pk_struct_type_set_fname (pk_val type, uint64_t idx, pk_val field_name);
+void pk_struct_type_set_fname (pk_val type, uint64_t idx,
+                               pk_val field_name) LIBPOKE_API;
 
 /* Get type of a field in the struct.
 
@@ -762,7 +774,7 @@ void pk_struct_type_set_fname (pk_val type, uint64_t idx, 
pk_val field_name);
 
    If IDX is invalid, PK_NULL is returned.  */
 
-pk_val pk_struct_type_ftype (pk_val type, uint64_t idx);
+pk_val pk_struct_type_ftype (pk_val type, uint64_t idx) LIBPOKE_API;
 
 /* Set the type of a field of a struct type.
 
@@ -774,8 +786,8 @@ pk_val pk_struct_type_ftype (pk_val type, uint64_t idx);
 
    If IDX is invalid, type remains unchanged.  */
 
-void pk_struct_type_set_ftype
-(pk_val type, uint64_t idx, pk_val field_type);
+void pk_struct_type_set_ftype (pk_val type, uint64_t idx,
+                               pk_val field_type) LIBPOKE_API;
 
 /* Array types.  */
 
@@ -787,38 +799,38 @@ void pk_struct_type_set_ftype
    array... XXX or a closure?? cant remember. At the moment the PKL
    compiler generates PVM_NULL for this... */
 
-pk_val pk_make_array_type (pk_val etype, pk_val bound);
+pk_val pk_make_array_type (pk_val etype, pk_val bound) LIBPOKE_API;
 
 /* Get the type of the elements of the given array type.  */
 
-pk_val pk_array_type_etype (pk_val type);
+pk_val pk_array_type_etype (pk_val type) LIBPOKE_API;
 
 /* Get the bound of the given array type.  */
 
-pk_val pk_array_type_bound (pk_val type);
+pk_val pk_array_type_bound (pk_val type) LIBPOKE_API;
 
 /* Mapped values.  */
 
 /* Return a boolean indicating whether the given value is mapped or
    not.  */
 
-int pk_val_mapped_p (pk_val val);
+int pk_val_mapped_p (pk_val val) LIBPOKE_API;
 
 /* Return the IOS identifier, an int<32>, in which the given value is
    mapped.  If the value is not mapped, return PK_NULL.  */
 
-pk_val pk_val_ios (pk_val val);
+pk_val pk_val_ios (pk_val val) LIBPOKE_API;
 
 /* Return the offset in which the given value is mapped.
    If the value is not mapped, return PK_NULL.  */
 
-pk_val pk_val_offset (pk_val val);
+pk_val pk_val_offset (pk_val val) LIBPOKE_API;
 
 /* Other operations on values.  */
 
 /* Return the type of the given value.  */
 
-pk_val pk_typeof (pk_val val);
+pk_val pk_typeof (pk_val val) LIBPOKE_API;
 
 /* Given a type value, return its code.  */
 
@@ -832,16 +844,16 @@ pk_val pk_typeof (pk_val val);
 #define PK_CLOSURE 7
 #define PK_ANY     8
 
-int pk_type_code (pk_val val);
+int pk_type_code (pk_val val) LIBPOKE_API;
 
 /* Compare two Poke values.
 
    Returns 1 if they match, 0 otherwise.  */
 
-int pk_val_equal_p (pk_val val1, pk_val val2);
+int pk_val_equal_p (pk_val val1, pk_val val2) LIBPOKE_API;
 
 /* Print the given value.   */
 
-void pk_print_val (pk_compiler pkc, pk_val val);
+void pk_print_val (pk_compiler pkc, pk_val val) LIBPOKE_API;
 
 #endif /* ! LIBPOKE_H */
diff --git a/libpoke/pkl-asm.h b/libpoke/pkl-asm.h
index b217b850..d4bee9fd 100644
--- a/libpoke/pkl-asm.h
+++ b/libpoke/pkl-asm.h
@@ -67,29 +67,25 @@ typedef struct pkl_asm *pkl_asm;
    PVM program.  */
 
 pkl_asm pkl_asm_new (pkl_ast ast, pkl_compiler compiler,
-                     int prologue)
-  __attribute__ ((visibility ("hidden")));
+                     int prologue);
 
 /* Finish the assembly of the current program and return it.  This
    function frees all resources used by the assembler instance, and
    `pkl_asm_new' should be called again in order to assemble another
    program.  */
 
-pvm_program pkl_asm_finish (pkl_asm pasm, int epilogue)
-  __attribute__ ((visibility ("hidden")));
+pvm_program pkl_asm_finish (pkl_asm pasm, int epilogue);
 
 /* Assemble an instruction INSN and append it to the program being
    assembled in PASM.  If the instruction takes any argument, they
    follow after INSN.  */
 
-void pkl_asm_insn (pkl_asm pasm, enum pkl_asm_insn insn, ...)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_insn (pkl_asm pasm, enum pkl_asm_insn insn, ...);
 
 /* Emit assembly code for calling the function FUNCNAME, which should
    be defined in the global environment.  */
 
-void pkl_asm_call (pkl_asm pasm, const char *funcname)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_call (pkl_asm pasm, const char *funcname);
 
 /* Conditionals.
  *
@@ -112,17 +108,13 @@ void pkl_asm_call (pkl_asm pasm, const char *funcname)
  * type.
  */
 
-void pkl_asm_if (pkl_asm pasm, pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_if (pkl_asm pasm, pkl_ast_node exp);
 
-void pkl_asm_then (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_then (pkl_asm pasm);
 
-void pkl_asm_else (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_else (pkl_asm pasm);
 
-void pkl_asm_endif (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_endif (pkl_asm pasm);
 
 /* Simple loops.
  *
@@ -133,11 +125,9 @@ void pkl_asm_endif (pkl_asm pasm)
  * pkl_asm_endloop (pasm);
  */
 
-void pkl_asm_loop (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_loop (pkl_asm pasm);
 
-void pkl_asm_endloop (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_endloop (pkl_asm pasm);
 
 /* While loops.
  *
@@ -155,14 +145,11 @@ void pkl_asm_endloop (pkl_asm pasm)
  * int<32> value, and this is assumed by pkl_asm_while_loop.
  */
 
-void pkl_asm_while (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_while (pkl_asm pasm);
 
-void pkl_asm_while_loop (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_while_loop (pkl_asm pasm);
 
-void pkl_asm_while_endloop (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_while_endloop (pkl_asm pasm);
 
 /* For-in-where loops.
  *
@@ -185,17 +172,13 @@ void pkl_asm_while_endloop (pkl_asm pasm)
  */
 
 void pkl_asm_for (pkl_asm pasm, int container_type,
-                  pkl_ast_node selector)
-  __attribute__ ((visibility ("hidden")));
+                  pkl_ast_node selector);
 
-void pkl_asm_for_where (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_for_where (pkl_asm pasm);
 
-void pkl_asm_for_loop (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_for_loop (pkl_asm pasm);
 
-void pkl_asm_for_endloop (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_for_endloop (pkl_asm pasm);
 
 /* Try-catch blocks.
  *
@@ -210,21 +193,17 @@ void pkl_asm_for_endloop (pkl_asm pasm)
  * pkl_asm_endtry (pasm);
  */
 
-void pkl_asm_try (pkl_asm pasm, pkl_ast_node type)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_try (pkl_asm pasm, pkl_ast_node type);
 
-void pkl_asm_catch (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_catch (pkl_asm pasm);
 
-void pkl_asm_endtry (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_endtry (pkl_asm pasm);
 
 /* The following function returns the label associated to the
    enclosing break-able construction (such as a loop or a switch).  If
    there is not such enclosign environment, this function aborts.  */
 
-pvm_program_label pkl_asm_break_label (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+pvm_program_label pkl_asm_break_label (pkl_asm pasm);
 
 /* Assembler directives:
  *
@@ -244,15 +223,12 @@ pvm_program_label pkl_asm_break_label (pkl_asm pasm)
  *       loc lb,le,cb,ce
  */
 
-void pkl_asm_note (pkl_asm pasm, const char *str)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_note (pkl_asm pasm, const char *str);
 
 /* Allocate a fresh PVM label and return it.  */
-pvm_program_label pkl_asm_fresh_label (pkl_asm pasm)
-  __attribute__ ((visibility ("hidden")));
+pvm_program_label pkl_asm_fresh_label (pkl_asm pasm);
 
 /* Append a label.  */
-void pkl_asm_label (pkl_asm pasm, pvm_program_label label)
-  __attribute__ ((visibility ("hidden")));
+void pkl_asm_label (pkl_asm pasm, pvm_program_label label);
 
 #endif /* PKL_ASM_H */
diff --git a/libpoke/pkl-ast.h b/libpoke/pkl-ast.h
index 8a4f739a..d56d80b3 100644
--- a/libpoke/pkl-ast.h
+++ b/libpoke/pkl-ast.h
@@ -262,8 +262,7 @@ struct pkl_ast_common
 };
 
 pkl_ast_node pkl_ast_chainon (pkl_ast_node ast1,
-                              pkl_ast_node ast2)
-  __attribute__ ((visibility ("hidden")));
+                              pkl_ast_node ast2);
 
 typedef struct pkl_ast *pkl_ast; /* Forward declaration. */
 
@@ -282,8 +281,7 @@ struct pkl_ast_program
 };
 
 pkl_ast_node pkl_ast_make_program (pkl_ast ast,
-                                   pkl_ast_node declarations)
-  __attribute__ ((visibility ("hidden")));
+                                   pkl_ast_node declarations);
 
 /* PKL_AST_IDENTIFIER nodes represent identifiers in PKL programs.
 
@@ -310,8 +308,7 @@ struct pkl_ast_identifier
 };
 
 pkl_ast_node pkl_ast_make_identifier (pkl_ast ast,
-                                      const char *str)
-  __attribute__ ((visibility ("hidden")));
+                                      const char *str);
 
 /* PKL_AST_INTEGER nodes represent integer constants in poke programs.
 
@@ -328,8 +325,7 @@ struct pkl_ast_integer
 };
 
 pkl_ast_node pkl_ast_make_integer (pkl_ast ast,
-                                   uint64_t value)
-  __attribute__ ((visibility ("hidden")));
+                                   uint64_t value);
 
 /* PKL_AST_STRING nodes represent string literals in PKL programs.
 
@@ -347,8 +343,7 @@ struct pkl_ast_string
 };
 
 pkl_ast_node pkl_ast_make_string (pkl_ast ast,
-                                  const char *str)
-  __attribute__ ((visibility ("hidden")));
+                                  const char *str);
 
 /* PKL_AST_ARRAY nodes represent array literals.  Each array holds a
    sequence of elements, all of them having the same type.  There must
@@ -371,8 +366,7 @@ struct pkl_ast_array
 pkl_ast_node pkl_ast_make_array (pkl_ast ast,
                                  size_t nelem,
                                  size_t ninitializer,
-                                 pkl_ast_node initializers)
-  __attribute__ ((visibility ("hidden")));
+                                 pkl_ast_node initializers);
 
 
 /* PKL_AST_ARRAY_INITIALIZER nodes represent initializers in array
@@ -392,8 +386,7 @@ struct pkl_ast_array_initializer
 
 pkl_ast_node pkl_ast_make_array_initializer (pkl_ast ast,
                                              pkl_ast_node index,
-                                             pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+                                             pkl_ast_node exp);
 
 
 /* PKL_AST_STRUCT nodes represent struct literals.  */
@@ -411,8 +404,7 @@ struct pkl_ast_struct
 
 pkl_ast_node pkl_ast_make_struct (pkl_ast ast,
                                   size_t nelem,
-                                  pkl_ast_node elems)
-  __attribute__ ((visibility ("hidden")));
+                                  pkl_ast_node elems);
 
 /* PKL_AST_STRUCT_FIELD nodes represent elements in struct
    literals.
@@ -435,8 +427,7 @@ struct pkl_ast_struct_field
 
 pkl_ast_node pkl_ast_make_struct_field (pkl_ast ast,
                                         pkl_ast_node name,
-                                        pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+                                        pkl_ast_node exp);
 
 /* PKL_AST_EXP nodes represent unary and binary expressions,
    consisting on an operator and one or two operators, respectively.
@@ -471,14 +462,12 @@ struct pkl_ast_exp
 
 pkl_ast_node pkl_ast_make_unary_exp (pkl_ast ast,
                                      enum pkl_ast_op code,
-                                     pkl_ast_node op)
-  __attribute__ ((visibility ("hidden")));
+                                     pkl_ast_node op);
 
 pkl_ast_node pkl_ast_make_binary_exp (pkl_ast ast,
                                       enum pkl_ast_op code,
                                       pkl_ast_node op1,
-                                      pkl_ast_node op2)
-  __attribute__ ((visibility ("hidden")));
+                                      pkl_ast_node op2);
 
 const char *pkl_attr_name (enum pkl_ast_attr attr);
 
@@ -508,8 +497,7 @@ struct pkl_ast_cond_exp
 pkl_ast_node pkl_ast_make_cond_exp (pkl_ast ast,
                                     pkl_ast_node cond,
                                     pkl_ast_node thenexp,
-                                    pkl_ast_node elseexp)
-  __attribute__ ((visibility ("hidden")));
+                                    pkl_ast_node elseexp);
 
 /* PKL_AST_ENUMERATOR nodes represent the definition of a constant
    into an enumeration.
@@ -535,8 +523,7 @@ struct pkl_ast_enumerator
 
 pkl_ast_node pkl_ast_make_enumerator (pkl_ast ast,
                                       pkl_ast_node identifier,
-                                      pkl_ast_node value)
-  __attribute__ ((visibility ("hidden")));
+                                      pkl_ast_node value);
 
 /* PKL_AST_ENUM nodes represent enumerations, having semantics much
    like the C enums.
@@ -561,8 +548,7 @@ struct pkl_ast_enum
 
 pkl_ast_node pkl_ast_make_enum (pkl_ast ast,
                                 pkl_ast_node tag,
-                                pkl_ast_node values)
-  __attribute__ ((visibility ("hidden")));
+                                pkl_ast_node values);
 
 /* PKL_AST_FUNC nodes represent a function definition.
 
@@ -621,11 +607,9 @@ struct pkl_ast_func
 pkl_ast_node pkl_ast_make_func (pkl_ast ast,
                                 pkl_ast_node ret_type,
                                 pkl_ast_node args,
-                                pkl_ast_node body)
-  __attribute__ ((visibility ("hidden")));
+                                pkl_ast_node body);
 
-int pkl_ast_func_all_optargs (pkl_ast_node type)
-  __attribute__ ((visibility ("hidden")));
+int pkl_ast_func_all_optargs (pkl_ast_node type);
 
 /* PKL_AST_FUNC_ARG nodes represent a formal argument in a function
    definition.
@@ -659,8 +643,7 @@ struct pkl_ast_func_arg
 pkl_ast_node pkl_ast_make_func_arg (pkl_ast ast,
                                     pkl_ast_node type,
                                     pkl_ast_node identifier,
-                                    pkl_ast_node init)
-  __attribute__ ((visibility ("hidden")));
+                                    pkl_ast_node init);
 
 /* PKL_AST_TRIMMER nodes represent a trim of an array, or a string.
 
@@ -692,8 +675,7 @@ struct pkl_ast_trimmer
 pkl_ast_node pkl_ast_make_trimmer (pkl_ast ast,
                                    pkl_ast_node entity,
                                    pkl_ast_node from,
-                                   pkl_ast_node to)
-  __attribute__ ((visibility ("hidden")));
+                                   pkl_ast_node to);
 
 /* PKL_AST_INDEXER nodes represent references to an array element.
 
@@ -714,8 +696,7 @@ struct pkl_ast_indexer
 
 pkl_ast_node pkl_ast_make_indexer (pkl_ast ast,
                                      pkl_ast_node array,
-                                     pkl_ast_node index)
-  __attribute__ ((visibility ("hidden")));
+                                     pkl_ast_node index);
 
 /* PKL_AST_STRUCT_REF nodes represent references to a struct
    element.  */
@@ -733,8 +714,7 @@ struct pkl_ast_struct_ref
 
 pkl_ast_node pkl_ast_make_struct_ref (pkl_ast ast,
                                       pkl_ast_node sct,
-                                      pkl_ast_node identifier)
-  __attribute__ ((visibility ("hidden")));
+                                      pkl_ast_node identifier);
 
 /* PKL_AST_STRUCT_TYPE_FIELD nodes represent the field part of a
    struct type.
@@ -790,8 +770,7 @@ pkl_ast_node pkl_ast_make_struct_type_field (pkl_ast ast,
                                              pkl_ast_node initializer,
                                              pkl_ast_node label,
                                              int endian,
-                                             pkl_ast_node optcond)
-   __attribute__ ((visibility ("hidden")));
+                                             pkl_ast_node optcond);
 
 /* PKL_AST_FUNC_TYPE_ARG nodes represent the arguments part of a
    function type.
@@ -820,8 +799,7 @@ struct pkl_ast_func_type_arg
 };
 
 pkl_ast_node pkl_ast_make_func_type_arg (pkl_ast ast,
-                                         pkl_ast_node type, pkl_ast_node name)
-  __attribute__ ((visibility ("hidden")));
+                                         pkl_ast_node type, pkl_ast_node name);
 
 /* PKL_AST_TYPE nodes represent type expressions.
 
@@ -975,72 +953,52 @@ struct pkl_ast_type
   } val;
 };
 
-pkl_ast_node pkl_ast_make_named_type (pkl_ast ast, pkl_ast_node name)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_named_type (pkl_ast ast, pkl_ast_node name);
 
-pkl_ast_node pkl_ast_make_integral_type (pkl_ast ast, size_t size, int 
signed_p)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_integral_type (pkl_ast ast, size_t size, int 
signed_p);
 
-pkl_ast_node pkl_ast_make_void_type (pkl_ast ast)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_void_type (pkl_ast ast);
 
-pkl_ast_node pkl_ast_make_string_type (pkl_ast ast)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_string_type (pkl_ast ast);
 
 pkl_ast_node pkl_ast_make_array_type (pkl_ast ast, pkl_ast_node etype,
-                                      pkl_ast_node bound)
-  __attribute__ ((visibility ("hidden")));
+                                      pkl_ast_node bound);
 
 pkl_ast_node pkl_ast_make_struct_type (pkl_ast ast, size_t nelem, size_t 
nfield,
                                        size_t ndecl, pkl_ast_node itype,
                                        pkl_ast_node elems,
-                                       int pinned_p, int union_p)
-  __attribute__ ((visibility ("hidden")));
+                                       int pinned_p, int union_p);
 
 pkl_ast_node pkl_ast_make_offset_type (pkl_ast ast, pkl_ast_node base_type,
-                                       pkl_ast_node unit)
-  __attribute__ ((visibility ("hidden")));
+                                       pkl_ast_node unit);
 
 pkl_ast_node pkl_ast_make_function_type (pkl_ast ast, pkl_ast_node rtype,
-                                         size_t narg, pkl_ast_node args)
-  __attribute__ ((visibility ("hidden")));
+                                         size_t narg, pkl_ast_node args);
 
-pkl_ast_node pkl_ast_make_any_type (pkl_ast)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_any_type (pkl_ast);
 
-pkl_ast_node pkl_ast_dup_type (pkl_ast_node type)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_dup_type (pkl_ast_node type);
 
-int pkl_ast_type_equal (pkl_ast_node t1, pkl_ast_node t2)
-  __attribute__ ((visibility ("hidden")));
+int pkl_ast_type_equal (pkl_ast_node t1, pkl_ast_node t2);
 
-int pkl_ast_type_mappable_p (pkl_ast_node type)
-  __attribute__ ((visibility ("hidden")));
+int pkl_ast_type_mappable_p (pkl_ast_node type);
 
-int pkl_ast_type_is_exception (pkl_ast_node type)
-  __attribute__ ((visibility ("hidden")));
+int pkl_ast_type_is_exception (pkl_ast_node type);
 
 int pkl_ast_type_promoteable (pkl_ast_node ft, pkl_ast_node tt,
-                              int promote_array_of_any)
-  __attribute__ ((visibility ("hidden")));
+                              int promote_array_of_any);
 
-pkl_ast_node pkl_ast_sizeof_type (pkl_ast ast, pkl_ast_node type)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_sizeof_type (pkl_ast ast, pkl_ast_node type);
 
-int pkl_ast_type_is_complete (pkl_ast_node type)
-  __attribute__ ((visibility ("hidden")));
+int pkl_ast_type_is_complete (pkl_ast_node type);
 
-void pkl_ast_array_type_remove_bounders (pkl_ast_node type)
-  __attribute__ ((visibility ("hidden")));
+void pkl_ast_array_type_remove_bounders (pkl_ast_node type);
 
-void pkl_print_type (FILE *out, pkl_ast_node type, int use_given_name)
-  __attribute__ ((visibility ("hidden")));
+void pkl_print_type (FILE *out, pkl_ast_node type, int use_given_name);
 
-char *pkl_type_str (pkl_ast_node type, int use_given_name)
-  __attribute__ ((visibility ("hidden")));
+char *pkl_type_str (pkl_ast_node type, int use_given_name);
 
-pkl_ast_node pkl_struct_type_traverse (pkl_ast_node type, const char *path)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_struct_type_traverse (pkl_ast_node type, const char *path);
 
 /* PKL_AST_DECL nodes represent the declaration of a named entity:
    function, type, variable....
@@ -1100,8 +1058,7 @@ struct pkl_ast_decl
 
 pkl_ast_node pkl_ast_make_decl (pkl_ast ast, int kind,
                                 pkl_ast_node name, pkl_ast_node initial,
-                                const char *source)
-  __attribute__ ((visibility ("hidden")));
+                                const char *source);
 
 /* PKL_AST_OFFSET nodes represent poke object constructions.
 
@@ -1130,8 +1087,7 @@ struct pkl_ast_offset
 
 pkl_ast_node pkl_ast_make_offset (pkl_ast ast,
                                   pkl_ast_node magnitude,
-                                  pkl_ast_node unit)
-  __attribute__ ((visibility ("hidden")));
+                                  pkl_ast_node unit);
 
 /* PKL_AST_CAST nodes represent casts at the language level.
 
@@ -1152,8 +1108,7 @@ struct pkl_ast_cast
 
 pkl_ast_node pkl_ast_make_cast (pkl_ast ast,
                                 pkl_ast_node type,
-                                pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+                                pkl_ast_node exp);
 
 /* PKL_AST_ISA nodes represent an application of the ISA operator.
 
@@ -1173,8 +1128,7 @@ struct pkl_ast_isa
 
 pkl_ast_node pkl_ast_make_isa (pkl_ast ast,
                                pkl_ast_node type,
-                               pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+                               pkl_ast_node exp);
 
 /* PKL_AST_MAP nodes represent maps, i.e. the mapping of some type at
    some offset in IO space.
@@ -1203,8 +1157,7 @@ struct pkl_ast_map
 pkl_ast_node pkl_ast_make_map (pkl_ast ast,
                                pkl_ast_node type,
                                pkl_ast_node ios,
-                               pkl_ast_node offset)
-  __attribute__ ((visibility ("hidden")));
+                               pkl_ast_node offset);
 
 /* PKL_AST_SCONS nodes represent struct constructors.
 
@@ -1225,8 +1178,7 @@ struct pkl_ast_scons
 
 pkl_ast_node pkl_ast_make_scons (pkl_ast ast,
                                  pkl_ast_node type,
-                                 pkl_ast_node value)
-  __attribute__ ((visibility ("hidden")));
+                                 pkl_ast_node value);
 
 /* PKL_AST_FUNCALL nodes represent the invocation of a function.
 
@@ -1250,8 +1202,7 @@ struct pkl_ast_funcall
 
 pkl_ast_node pkl_ast_make_funcall (pkl_ast ast,
                                    pkl_ast_node function,
-                                   pkl_ast_node args)
-  __attribute__ ((visibility ("hidden")));
+                                   pkl_ast_node args);
 
 /* PKL_AST_FUNCALL_ARG nodes represent actual arguments in function
    calls.
@@ -1280,8 +1231,7 @@ struct pkl_ast_funcall_arg
 };
 
 pkl_ast_node pkl_ast_make_funcall_arg (pkl_ast ast, pkl_ast_node exp,
-                                       pkl_ast_node name)
-  __attribute__ ((visibility ("hidden")));
+                                       pkl_ast_node name);
 
 /* PKL_AST_VAR nodes represent variable references.
 
@@ -1331,8 +1281,7 @@ struct pkl_ast_var
 pkl_ast_node pkl_ast_make_var (pkl_ast ast,
                                pkl_ast_node name,
                                pkl_ast_node initial,
-                               int back, int over)
-  __attribute__ ((visibility ("hidden")));
+                               int back, int over);
 
 /* PKL_AST_COMPOUND_STMT nodes represent compound statements in the
    language.
@@ -1369,11 +1318,9 @@ struct pkl_ast_comp_stmt
   int numvars;
 };
 
-pkl_ast_node pkl_ast_make_comp_stmt (pkl_ast ast, pkl_ast_node stmts)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_comp_stmt (pkl_ast ast, pkl_ast_node stmts);
 
-pkl_ast_node pkl_ast_make_builtin (pkl_ast ast, int builtin)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_builtin (pkl_ast ast, int builtin);
 
 /* PKL_AST_NULL_STMT nodes represent the "null statement".  It can
    appear anywhere an statement is expected, but it has no effect.  */
@@ -1383,8 +1330,7 @@ struct pkl_ast_null_stmt
   struct pkl_ast_common common;
 };
 
-pkl_ast_node pkl_ast_make_null_stmt (pkl_ast ast)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_null_stmt (pkl_ast ast);
 
 /* PKL_AST_ASS_STMT nodes represent assignment statements in the
    language.
@@ -1414,8 +1360,7 @@ struct pkl_ast_ass_stmt
 };
 
 pkl_ast_node pkl_ast_make_ass_stmt (pkl_ast ast,
-                                    pkl_ast_node lvalue, pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+                                    pkl_ast_node lvalue, pkl_ast_node exp);
 
 /* PKL_AST_IF_STMT nodes represent conditional statements, with an
    optional `else' part.
@@ -1442,11 +1387,9 @@ struct pkl_ast_if_stmt
 pkl_ast_node pkl_ast_make_if_stmt (pkl_ast ast,
                                    pkl_ast_node exp,
                                    pkl_ast_node then_stmt,
-                                   pkl_ast_node else_stmt)
-  __attribute__ ((visibility ("hidden")));
+                                   pkl_ast_node else_stmt);
 
-int pkl_ast_lvalue_p (pkl_ast_node node)
-  __attribute__ ((visibility ("hidden")));
+int pkl_ast_lvalue_p (pkl_ast_node node);
 
 /* PKL_AST_LOOP_STMT nodes represent iterative statements.
 
@@ -1477,8 +1420,7 @@ struct pkl_ast_loop_stmt
 pkl_ast_node pkl_ast_make_loop_stmt (pkl_ast ast,
                                      pkl_ast_node iterator,
                                      pkl_ast_node condition,
-                                     pkl_ast_node body)
-  __attribute__ ((visibility ("hidden")));
+                                     pkl_ast_node body);
 
 /* PKL_AST_LOOP_STMT_ITERATOR nodes represent an iterator in a loop
    statement.
@@ -1502,8 +1444,7 @@ struct pkl_ast_loop_stmt_iterator
 
 pkl_ast_node pkl_ast_make_loop_stmt_iterator (pkl_ast ast,
                                               pkl_ast_node decl,
-                                              pkl_ast_node container)
-  __attribute__ ((visibility ("hidden")));
+                                              pkl_ast_node container);
 
 /* PKL_AST_RETURN_STMT nodes represent return statements.
 
@@ -1533,11 +1474,9 @@ struct pkl_ast_return_stmt
   int ndrops;
 };
 
-pkl_ast_node pkl_ast_make_return_stmt (pkl_ast ast, pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_return_stmt (pkl_ast ast, pkl_ast_node exp);
 
-void pkl_ast_finish_returns (pkl_ast_node function)
-  __attribute__ ((visibility ("hidden")));
+void pkl_ast_finish_returns (pkl_ast_node function);
 
 /* PKL_AST_EXP_STMT nodes represent "expression statements".
 
@@ -1551,8 +1490,7 @@ struct pkl_ast_exp_stmt
   union pkl_ast_node *exp;
 };
 
-pkl_ast_node pkl_ast_make_exp_stmt (pkl_ast ast, pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_exp_stmt (pkl_ast ast, pkl_ast_node exp);
 
 /* PKL_AST_TRY_UNTIL_STMT nodes represent try-until statements.
 
@@ -1574,8 +1512,7 @@ struct pkl_ast_try_until_stmt
 };
 
 pkl_ast_node pkl_ast_make_try_until_stmt (pkl_ast ast,
-                                          pkl_ast_node code, pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+                                          pkl_ast_node code, pkl_ast_node exp);
 
 /* PKL_AST_TRY_CATCH_STMT nodes represent try-catch statements, which
    are used in order to support exception handlers.
@@ -1611,8 +1548,7 @@ struct pkl_ast_try_catch_stmt
 
 pkl_ast_node pkl_ast_make_try_catch_stmt (pkl_ast ast,
                                           pkl_ast_node code, pkl_ast_node 
handler,
-                                          pkl_ast_node arg, pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+                                          pkl_ast_node arg, pkl_ast_node exp);
 
 /* PKL_AST_PRINT_STMT nodes represent `print' statements.
 
@@ -1656,8 +1592,7 @@ struct pkl_ast_print_stmt
 };
 
 pkl_ast_node pkl_ast_make_print_stmt (pkl_ast ast,
-                                      pkl_ast_node fmt, pkl_ast_node args)
-  __attribute__ ((visibility ("hidden")));
+                                      pkl_ast_node fmt, pkl_ast_node args);
 
 /* PKL_AST_PRINT_STMT_ARG nodes represent expression arguments to
    `printf' statements.
@@ -1711,8 +1646,7 @@ struct pkl_ast_print_stmt_arg
   union pkl_ast_node *exp;
 };
 
-pkl_ast_node pkl_ast_make_print_stmt_arg (pkl_ast ast, pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_print_stmt_arg (pkl_ast ast, pkl_ast_node exp);
 
 /* PKL_AST_BREAK_STMT nodes represent `break' statements.  Each break
    statement is associated to a loop or switch node.
@@ -1733,11 +1667,9 @@ struct pkl_ast_break_stmt
   int nframes;
 };
 
-pkl_ast_node pkl_ast_make_break_stmt (pkl_ast ast)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_break_stmt (pkl_ast ast);
 
-void pkl_ast_finish_breaks (pkl_ast_node entity, pkl_ast_node stmt)
-  __attribute__ ((visibility ("hidden")));
+void pkl_ast_finish_breaks (pkl_ast_node entity, pkl_ast_node stmt);
 
 /* PKL_AST_RAISE_STMT nodes represent `raise' statements, which are
    used in order to raise exceptions at the program level.
@@ -1753,8 +1685,7 @@ struct pkl_ast_raise_stmt
   union pkl_ast_node *exp;
 };
 
-pkl_ast_node pkl_ast_make_raise_stmt (pkl_ast ast, pkl_ast_node exp)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_make_raise_stmt (pkl_ast ast, pkl_ast_node exp);
 
 /* Finally, the `pkl_ast_node' type, which represents an AST node of
    any type.  */
@@ -1839,25 +1770,19 @@ struct pkl_ast
   char *filename;
 };
 
-pkl_ast pkl_ast_init (void)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast pkl_ast_init (void);
 
-void pkl_ast_free (pkl_ast ast)
-  __attribute__ ((visibility ("hidden")));
+void pkl_ast_free (pkl_ast ast);
 
-void pkl_ast_node_free (pkl_ast_node ast)
-  __attribute__ ((visibility ("hidden")));
+void pkl_ast_node_free (pkl_ast_node ast);
 
-void pkl_ast_node_free_chain (pkl_ast_node ast)
-  __attribute__ ((visibility ("hidden")));
+void pkl_ast_node_free_chain (pkl_ast_node ast);
 
 /* Reverse the order of elements chained by CHAIN, and return the new
    head of the chain (old last element).  */
 
-pkl_ast_node pkl_ast_reverse (pkl_ast_node ast)
-  __attribute__ ((visibility ("hidden")));
+pkl_ast_node pkl_ast_reverse (pkl_ast_node ast);
 
-void pkl_ast_print (FILE *fp, pkl_ast_node ast)
-  __attribute__ ((visibility ("hidden")));
+void pkl_ast_print (FILE *fp, pkl_ast_node ast);
 
 #endif /* ! PKL_AST_H */
diff --git a/libpoke/pkl-diag.h b/libpoke/pkl-diag.h
index a08a953d..8f788a96 100644
--- a/libpoke/pkl-diag.h
+++ b/libpoke/pkl-diag.h
@@ -25,15 +25,12 @@
 #include "pkl-ast.h"
 
 void pkl_error (pkl_compiler compiler, pkl_ast ast, pkl_ast_loc loc,
-                const char *fmt, ...)
-  __attribute__ ((visibility ("hidden")));
+                const char *fmt, ...);
 
 void pkl_warning (pkl_compiler compiler, pkl_ast ast,
-                  pkl_ast_loc loc, const char *fmt, ...)
-  __attribute__ ((visibility ("hidden")));
+                  pkl_ast_loc loc, const char *fmt, ...);
 
 void pkl_ice (pkl_compiler compiler, pkl_ast ast, pkl_ast_loc loc,
-              const char *fmt, ...)
-  __attribute__ ((visibility ("hidden")));
+              const char *fmt, ...);
 
 #endif /* ! PKL_DIAG_H */
diff --git a/libpoke/pkl-env.h b/libpoke/pkl-env.h
index 1f809947..c1383ac8 100644
--- a/libpoke/pkl-env.h
+++ b/libpoke/pkl-env.h
@@ -59,26 +59,22 @@ typedef struct pkl_env *pkl_env;  /* Struct defined in 
pkl-env.c */
 
 /* Get an empty environment.  */
 
-pkl_env pkl_env_new (void)
-  __attribute__ ((visibility ("hidden")));
+pkl_env pkl_env_new (void);
 
 /* Destroy ENV, freeing all resources.  */
 
-void pkl_env_free (pkl_env env)
-  __attribute__ ((visibility ("hidden")));
+void pkl_env_free (pkl_env env);
 
 /* Push a new frame to ENV and return the modified environment.  The
    new frame is empty.  */
 
-pkl_env pkl_env_push_frame (pkl_env env)
-  __attribute__ ((visibility ("hidden")));
+pkl_env pkl_env_push_frame (pkl_env env);
 
 /* Pop a frame from ENV and return the modified environment.  The
    contents of the popped frame are disposed.  Trying to pop the
    top-level frame is an error.  */
 
-pkl_env pkl_env_pop_frame (pkl_env env)
-  __attribute__ ((visibility ("hidden")));
+pkl_env pkl_env_pop_frame (pkl_env env);
 
 /* Register the declaration DECL in the current frame under NAME in
    the given NAMESPACE.  Return 1 if the declaration was properly
@@ -88,20 +84,17 @@ pkl_env pkl_env_pop_frame (pkl_env env)
 int pkl_env_register (pkl_env env,
                       int namespace,
                       const char *name,
-                      pkl_ast_node decl)
-  __attribute__ ((visibility ("hidden")));
+                      pkl_ast_node decl);
 
 /* Return 1 if the given ENV contains only one frame.  Return 0
    otherwise.  */
 
-int pkl_env_toplevel_p (pkl_env env)
-  __attribute__ ((visibility ("hidden")));
+int pkl_env_toplevel_p (pkl_env env);
 
 /* Return a copy of ENV.  Note this only works for top-level
    environments.  */
 
-pkl_env pkl_env_dup_toplevel (pkl_env env)
-  __attribute__ ((visibility ("hidden")));
+pkl_env pkl_env_dup_toplevel (pkl_env env);
 
 /* Declarations in Poke live in two different, separated name spaces:
 
@@ -123,8 +116,7 @@ pkl_env pkl_env_dup_toplevel (pkl_env env)
 
 pkl_ast_node pkl_env_lookup (pkl_env env, int namespace,
                              const char *name,
-                             int *back, int *over)
-  __attribute__ ((visibility ("hidden")));
+                             int *back, int *over);
 
 /* The following iterators work on the main namespace.  */
 
@@ -135,19 +127,15 @@ struct pkl_ast_node_iter
 };
 
 
-void pkl_env_iter_begin (pkl_env env, struct pkl_ast_node_iter *iter)
-  __attribute__ ((visibility ("hidden")));
+void pkl_env_iter_begin (pkl_env env, struct pkl_ast_node_iter *iter);
 
-void pkl_env_iter_next (pkl_env env, struct pkl_ast_node_iter *iter)
-  __attribute__ ((visibility ("hidden")));
+void pkl_env_iter_next (pkl_env env, struct pkl_ast_node_iter *iter);
 
-bool pkl_env_iter_end (pkl_env env, const struct pkl_ast_node_iter *iter)
-  __attribute__ ((visibility ("hidden")));
+bool pkl_env_iter_end (pkl_env env, const struct pkl_ast_node_iter *iter);
 
 char *pkl_env_get_next_matching_decl (pkl_env env,
                                       struct pkl_ast_node_iter *iter,
-                                      const char *name, size_t len)
-  __attribute__ ((visibility ("hidden")));
+                                      const char *name, size_t len);
 
 /* Map over the declarations defined in the top-level compile-time
    environment, executing a handler.  */
@@ -160,7 +148,6 @@ typedef void (*pkl_map_decl_fn) (pkl_ast_node decl, void 
*data);
 void pkl_env_map_decls (pkl_env env,
                         int what,
                         pkl_map_decl_fn cb,
-                        void *data)
-  __attribute__ ((visibility ("hidden")));
+                        void *data);
 
 #endif /* !PKL_ENV_H  */
diff --git a/libpoke/pkl-parser.h b/libpoke/pkl-parser.h
index 7eb9b3f2..1cec2f77 100644
--- a/libpoke/pkl-parser.h
+++ b/libpoke/pkl-parser.h
@@ -60,12 +60,10 @@ struct pkl_parser
 #define PKL_PARSE_STATEMENT 3
 
 int pkl_parse_file (pkl_compiler compiler, pkl_env *env, pkl_ast *ast,
-                    FILE *fp, const char *fname)
-  __attribute__ ((visibility ("hidden")));
+                    FILE *fp, const char *fname);
 
 int pkl_parse_buffer (pkl_compiler compiler, pkl_env *env, pkl_ast *ast,
-                      int what, const char *buffer, const char **end)
-  __attribute__ ((visibility ("hidden")));
+                      int what, const char *buffer, const char **end);
 
 
 
diff --git a/libpoke/pkl-pass.h b/libpoke/pkl-pass.h
index 34a6f252..05581ff1 100644
--- a/libpoke/pkl-pass.h
+++ b/libpoke/pkl-pass.h
@@ -331,16 +331,14 @@ pkl_phase_parent_in (pkl_ast_node parent,
 
 int pkl_do_pass (pkl_compiler compiler, pkl_ast ast,
                  struct pkl_phase *phases[], void *payloads[],
-                 int flags, int level)
-  __attribute__ ((visibility ("hidden")));
+                 int flags, int level);
 
 /* The following function is to be used by the PKL_PASS_SUBPASS macro
    defined above.  */
 
 int pkl_do_subpass (pkl_compiler compiler, pkl_ast ast, pkl_ast_node node,
                     struct pkl_phase *phases[], void *payloads[],
-                    int flags, int level)
-  __attribute__ ((visibility ("hidden")));
+                    int flags, int level);
 
 /* Macros to emit a compilation error, a warning or an ICE from a
    phase handler.  Using them reduces verbosity by not passing the
diff --git a/libpoke/pkl.h b/libpoke/pkl.h
index 905ff5f5..cb7fa6f7 100644
--- a/libpoke/pkl.h
+++ b/libpoke/pkl.h
@@ -77,11 +77,9 @@ typedef struct pkl_compiler *pkl_compiler; /* This data 
structure is
    If there is an error creating the compiler this function returns
    NULL.  */
 
-pkl_compiler pkl_new (pvm vm, const char *rt_path)
-  __attribute__ ((visibility ("hidden")));
+pkl_compiler pkl_new (pvm vm, const char *rt_path);
 
-void pkl_free (pkl_compiler compiler)
-  __attribute__ ((visibility ("hidden")));
+void pkl_free (pkl_compiler compiler);
 
 /* Compile an execute a Poke program from the given file FNAME.
    Return 1 if the compilation was successful, 0 otherwise.
@@ -90,8 +88,7 @@ void pkl_free (pkl_compiler compiler)
    executed program terminated.  */
 
 int pkl_execute_file (pkl_compiler compiler, const char *fname,
-                      int *exit_status)
-  __attribute__ ((visibility ("hidden")));
+                      int *exit_status);
 
 /* Compile and execute Poke program from a NULL-terminated string
    BUFFER.  Return 0 in case of a compilation error, 1 otherwise.  If
@@ -99,31 +96,27 @@ int pkl_execute_file (pkl_compiler compiler, const char 
*fname,
    part of the compiled entity.  */
 
 int pkl_execute_buffer (pkl_compiler compiler, const char *buffer,
-                        const char **end)
-  __attribute__ ((visibility ("hidden")));
+                        const char **end);
 
 /* Like pkl_execute_buffer, but compile and execute a single Poke
    expression, that generates a value in VAL. */
 
 int pkl_execute_expression (pkl_compiler compiler,
                             const char *buffer, const char **end,
-                            pvm_val *val)
-  __attribute__ ((visibility ("hidden")));
+                            pvm_val *val);
 
 /* Like pkl_execute_expression but compile and execute a single Poke statement,
    which may generate a value in VAL if it is an "expression
    statement".  Otherwise VAL is set to PVM_NULL.  */
 
 int pkl_execute_statement (pkl_compiler compiler, const char *buffer, const 
char **end,
-                           pvm_val *val)
-  __attribute__ ((visibility ("hidden")));
+                           pvm_val *val);
 
 /* Compile a single Poke expression and return the resulting PVM
    program.  */
 
 pvm_program pkl_compile_expression (pkl_compiler compiler,
-                                    const char *buffer, const char **end)
-  __attribute__ ((visibility ("hidden")));
+                                    const char *buffer, const char **end);
 
 /* Compile a program that calls to a function.
 
@@ -139,55 +132,45 @@ pvm_program pkl_compile_expression (pkl_compiler compiler,
    performing the operation.  */
 
 pvm_program pkl_compile_call (pkl_compiler compiler, pvm_val cls, pvm_val *ret,
-                              va_list ap)
-  __attribute__ ((visibility ("hidden")));
+                              va_list ap);
 
 /* Return the VM associated with COMPILER.  */
 
-pvm pkl_get_vm (pkl_compiler compiler)
-  __attribute__ ((visibility ("hidden")));
+pvm pkl_get_vm (pkl_compiler compiler);
 
 /* Return the current compile-time environment in COMPILER.  */
 
 typedef struct pkl_env *pkl_env;  /* Struct defined in pkl-env.c */
 
-pkl_env pkl_get_env (pkl_compiler compiler)
-  __attribute__ ((visibility ("hidden")));
+pkl_env pkl_get_env (pkl_compiler compiler);
 
 /* Returns a boolean telling whether the compiler has been
    bootstrapped.  */
 
-int pkl_bootstrapped_p (pkl_compiler compiler)
-  __attribute__ ((visibility ("hidden")));
+int pkl_bootstrapped_p (pkl_compiler compiler);
 
 /* Returns a boolean telling whether the compiler is compiling a
    single xexpression or a statement, respectively.  */
 
-int pkl_compiling_expression_p (pkl_compiler compiler)
-  __attribute__ ((visibility ("hidden")));
+int pkl_compiling_expression_p (pkl_compiler compiler);
 
-int pkl_compiling_statement_p (pkl_compiler compiler)
-  __attribute__ ((visibility ("hidden")));
+int pkl_compiling_statement_p (pkl_compiler compiler);
 
 /* Set/get the error-on-warning flag in/from the compiler.  If this
    flag is set, then warnings are handled like errors.  By default,
    the flag is not set.  */
 
-int pkl_error_on_warning (pkl_compiler compiler)
-  __attribute__ ((visibility ("hidden")));
+int pkl_error_on_warning (pkl_compiler compiler);
 
 void pkl_set_error_on_warning (pkl_compiler compiler,
-                               int error_on_warning)
-  __attribute__ ((visibility ("hidden")));
+                               int error_on_warning);
 
 /* Set/get the quiet_p flag in/from the compiler.  If this flag is
    set, the compiler emits as few output as possible.  */
 
-int pkl_quiet_p (pkl_compiler compiler)
-  __attribute__ ((visibility ("hidden")));
+int pkl_quiet_p (pkl_compiler compiler);
 
-void pkl_set_quiet_p (pkl_compiler compiler, int quiet_p)
-  __attribute__ ((visibility ("hidden")));
+void pkl_set_quiet_p (pkl_compiler compiler, int quiet_p);
 
 /* Get/install a handler for alien tokens.  */
 
@@ -197,19 +180,16 @@ typedef char *(*pkl_alien_token_handler_fn) (const char 
*id,
 pkl_alien_token_handler_fn pkl_alien_token_fn (pkl_compiler compiler);
 
 void pkl_set_alien_token_fn (pkl_compiler compiler,
-                             pkl_alien_token_handler_fn cb)
-  __attribute__ ((visibility ("hidden")));
+                             pkl_alien_token_handler_fn cb);
 
 /* Set/get the lexical_cuckolding_p flag in/from the compiler.  If
    this flag is set, the compiler will recognize alien tokens and
    call-back to the client for their resolution.  */
 
-int pkl_lexical_cuckolding_p (pkl_compiler compiler)
-    __attribute__ ((visibility ("hidden")));
+int pkl_lexical_cuckolding_p (pkl_compiler compiler);
 
 void pkl_set_lexical_cuckolding_p (pkl_compiler compiler,
-                                   int lexical_cuckolding_p)
-    __attribute__ ((visibility ("hidden")));
+                                   int lexical_cuckolding_p);
 
 /* Look for the module described by MODULE in the load_path of the
    given COMPILER, and return the path to its containing file.
@@ -220,15 +200,13 @@ void pkl_set_lexical_cuckolding_p (pkl_compiler compiler,
    path instead of a module name.  */
 
 char *pkl_resolve_module (pkl_compiler compiler, const char *module,
-                          int filename_p)
-  __attribute__ ((visibility ("hidden")));
+                          int filename_p);
 
 /* Load a module using the given compiler.
    If the module cannot be loaded, return 1.
    Otherwise, return 0.  */
 
-int pkl_load (pkl_compiler compiler, const char *module)
-  __attribute__ ((visibility ("hidden")));
+int pkl_load (pkl_compiler compiler, const char *module);
 
 /* Declare a variable in the global environmnt.
 
@@ -243,13 +221,11 @@ int pkl_defvar (pkl_compiler compiler,
 /* Given the path to a module file, determine the module is already
    loaded in the given compiler.  */
 
-int pkl_module_loaded_p (pkl_compiler compiler, const char *path)
-  __attribute__ ((visibility ("hidden")));
+int pkl_module_loaded_p (pkl_compiler compiler, const char *path);
 
 /* Add the module in the given path to the list of modules loaded in
    the compiler.  */
 
-void pkl_add_module (pkl_compiler compiler, const char *path)
-  __attribute__ ((visibility ("hidden")));
+void pkl_add_module (pkl_compiler compiler, const char *path);
 
 #endif /* ! PKL_H */
diff --git a/libpoke/pvm-alloc.h b/libpoke/pvm-alloc.h
index 3be49ef8..c9bb665c 100644
--- a/libpoke/pvm-alloc.h
+++ b/libpoke/pvm-alloc.h
@@ -29,18 +29,14 @@
    services shall be used once finalized, unless pvm_alloc_init is
    invoked again.  */
 
-void pvm_alloc_initialize (void)
-    __attribute__ ((visibility ("hidden")));
-void pvm_alloc_finalize (void)
-    __attribute__ ((visibility ("hidden")));
+void pvm_alloc_initialize (void);
+void pvm_alloc_finalize (void);
 
 /* Register/unregister NELEM pointers at POINTER as roots for the
    garbage-collector.  */
 
-void pvm_alloc_add_gc_roots (void *pointer, size_t nelems)
-  __attribute__ ((visibility ("hidden")));
-void pvm_alloc_remove_gc_roots (void *pointer, size_t nelems)
-  __attribute__ ((visibility ("hidden")));
+void pvm_alloc_add_gc_roots (void *pointer, size_t nelems);
+void pvm_alloc_remove_gc_roots (void *pointer, size_t nelems);
 
 /* Allocate SIZE bytes and return a pointer to the allocated memory.
    SIZE has the same semantics as in malloc(3).  On error, return
@@ -48,8 +44,7 @@ void pvm_alloc_remove_gc_roots (void *pointer, size_t nelems)
 
 void *pvm_alloc (size_t size)
   __attribute__ ((malloc))
-  __attribute__ ((alloc_size (1)))
-  __attribute__ ((visibility ("hidden")));
+  __attribute__ ((alloc_size (1)));
 
 /* Reallocate the given pointer to occupy SIZE bytes and return a
    pointer to the allocated memory.  SIZE has the same semantics as in
@@ -57,27 +52,23 @@ void *pvm_alloc (size_t size)
 
 void *pvm_realloc (void *ptr, size_t size)
   __attribute__ ((malloc))
-  __attribute__ ((alloc_size (2)))
-  __attribute__ ((visibility ("hidden")));
+  __attribute__ ((alloc_size (2)));
 
 /* Allocate a pvm_cls struct and return a pointer to the allocated
    memory.  This type-specific allocator is needed because the GC
    needs additional information to free these structs.  */
 
 void *pvm_alloc_cls (void)
-  __attribute__ ((malloc))
-  __attribute__ ((visibility ("hidden")));
+  __attribute__ ((malloc));
 
 /* Allocate and return a copy of the given STRING.  This call has the
    same semantics than strdup(3).  */
 
 char *pvm_alloc_strdup (const char *string)
-  __attribute__ ((malloc))
-  __attribute__ ((visibility ("hidden")));
+  __attribute__ ((malloc));
 
 /* Forced collection.  */
 
-void pvm_alloc_gc (void)
-  __attribute__ ((visibility ("hidden")));
+void pvm_alloc_gc (void);
 
 #endif /* ! PVM_ALLOC_H */
diff --git a/libpoke/pvm-program.h b/libpoke/pvm-program.h
index 7b69f370..06833c5a 100644
--- a/libpoke/pvm-program.h
+++ b/libpoke/pvm-program.h
@@ -25,11 +25,9 @@ typedef void *pvm_program_program_point; /* XXX better name 
*/
 
 /* Return the program point corresponding to the beginning of the
    given program.  */
-pvm_program_program_point pvm_program_beginning (pvm_program program)
-  __attribute__ ((visibility ("hidden")));
+pvm_program_program_point pvm_program_beginning (pvm_program program);
 
 /* Get the jitter routine associated with the program PROGRAM.  */
-pvm_routine pvm_program_routine (pvm_program program)
-  __attribute__ ((visibility ("hidden")));
+pvm_routine pvm_program_routine (pvm_program program);
 
 #endif /* ! PVM_PROGRAM_H */
diff --git a/libpoke/pvm-val.h b/libpoke/pvm-val.h
index a2bb8cdd..e5698d24 100644
--- a/libpoke/pvm-val.h
+++ b/libpoke/pvm-val.h
@@ -590,9 +590,7 @@ typedef struct pvm_off *pvm_off;
     } while (0)
 
 void pvm_allocate_struct_attrs (pvm_val nfields, pvm_val **fnames,
-                                pvm_val **ftypes)
-  __attribute__ ((visibility ("hidden")));
-void pvm_allocate_closure_attrs (pvm_val nargs, pvm_val **atypes)
-  __attribute__ ((visibility ("hidden")));
+                                pvm_val **ftypes);
+void pvm_allocate_closure_attrs (pvm_val nargs, pvm_val **atypes);
 
 #endif /* ! PVM_VAL_H */
diff --git a/libpoke/pvm.h b/libpoke/pvm.h
index 13475e3a..a9bc253e 100644
--- a/libpoke/pvm.h
+++ b/libpoke/pvm.h
@@ -74,33 +74,28 @@ typedef unsigned int pvm_register;
    The created program is returned.  If there is a problem creating
    the program then this function returns NULL.  */
 
-pvm_program pvm_program_new (void)
-  __attribute__ ((visibility ("hidden")));
+pvm_program pvm_program_new (void);
 
 /* Destroy the given PVM program.  */
 
-void pvm_destroy_program (pvm_program program)
-  __attribute__ ((visibility ("hidden")));
+void pvm_destroy_program (pvm_program program);
 
 /* Make the given PVM program executable so it can be run in the PVM.
 
    This function returns a status code indicating whether the
    operation was successful or not.  */
 
-int pvm_program_make_executable (pvm_program program)
-  __attribute__ ((visibility ("hidden")));
+int pvm_program_make_executable (pvm_program program);
 
 /* Print a native disassembly of the given program in the standard
    output.  */
 
-void pvm_disassemble_program_nat (pvm_program program)
-  __attribute__ ((visibility ("hidden")));
+void pvm_disassemble_program_nat (pvm_program program);
 
 /* Print a disassembly of the given program in the standard
    output.  */
 
-void pvm_disassemble_program (pvm_program program)
-  __attribute__ ((visibility ("hidden")));
+void pvm_disassemble_program (pvm_program program);
 
 /* **************** Assembling PVM Programs ****************  */
 
@@ -120,8 +115,7 @@ void pvm_disassemble_program (pvm_program program)
 /* Create a fresh label for the given program and return it.  This
    label should be eventually appended to the program.  */
 
-pvm_program_label pvm_program_fresh_label (pvm_program program)
-  __attribute__ ((visibility ("hidden")));
+pvm_program_label pvm_program_fresh_label (pvm_program program);
 
 /* Append a PVM value instruction parameter to a PVM program.
 
@@ -129,8 +123,7 @@ pvm_program_label pvm_program_fresh_label (pvm_program 
program)
    VAL is the PVM value to use as the instruction parameter.  */
 
 int pvm_program_append_val_parameter (pvm_program program,
-                                      pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+                                      pvm_val val);
 
 /* Append an unsigned integer literal instruction parameter to a PVM
    program.
@@ -139,8 +132,7 @@ int pvm_program_append_val_parameter (pvm_program program,
    N is the literal to use as the instruction parameter.  */
 
 int pvm_program_append_unsigned_parameter (pvm_program program,
-                                           unsigned int n)
-  __attribute__ ((visibility ("hidden")));
+                                           unsigned int n);
 
 /* Append a PVM register instruction parameter to a PVM program.
 
@@ -151,8 +143,7 @@ int pvm_program_append_unsigned_parameter (pvm_program 
program,
    PVM_EINVAL.  */
 
 int pvm_program_append_register_parameter (pvm_program program,
-                                           pvm_register reg)
-  __attribute__ ((visibility ("hidden")));
+                                           pvm_register reg);
 
 /* Appenda PVM label instruction parameter to a PVM program.
 
@@ -163,8 +154,7 @@ int pvm_program_append_register_parameter (pvm_program 
program,
    PVM_EINVAL.  */
 
 int pvm_program_append_label_parameter (pvm_program program,
-                                        pvm_program_label label)
-  __attribute__ ((visibility ("hidden")));
+                                        pvm_program_label label);
 
 /* Append an instruction to a PVM program.
 
@@ -178,8 +168,7 @@ int pvm_program_append_label_parameter (pvm_program program,
    already appended, this function returns PVM_EINSN.  */
 
 int pvm_program_append_instruction (pvm_program program,
-                                    const char *insn_name)
-  __attribute__ ((visibility ("hidden")));
+                                    const char *insn_name);
 
 /* Append a `push' instruction to a PVM program.
 
@@ -190,8 +179,7 @@ int pvm_program_append_instruction (pvm_program program,
    VAL is the PVM value that will be pushed by the instruction.  */
 
 int pvm_program_append_push_instruction (pvm_program program,
-                                         pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+                                         pvm_val val);
 
 /* Append a PVM label to a PVM program.
 
@@ -202,33 +190,27 @@ int pvm_program_append_push_instruction (pvm_program 
program,
    PVM_EINVAL.  */
 
 int pvm_program_append_label (pvm_program program,
-                              pvm_program_label label)
-  __attribute__ ((visibility ("hidden")));
+                              pvm_program_label label);
 
 /* **************** Building PVM Values **************** */
 
 /* Make signed and unsigned integer PVM values.
    SIZE is measured in bits and should be in the range 1 to 32.  */
 
-pvm_val pvm_make_int (int32_t value, int size)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_int (int32_t value, int size);
 
-pvm_val pvm_make_uint (uint32_t value, int size)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_uint (uint32_t value, int size);
 
 /* Make signed and unsigned long PVM values.
    SIZE is measured in bits and should be in the range 1 to 64.  */
 
-pvm_val pvm_make_long (int64_t value, int size)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_long (int64_t value, int size);
 
-pvm_val pvm_make_ulong (uint64_t value, int size)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_ulong (uint64_t value, int size);
 
 /* Make a string PVM value.  */
 
-pvm_val pvm_make_string (const char *value)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_string (const char *value);
 
 /* Make an offset PVM value.
 
@@ -237,8 +219,7 @@ pvm_val pvm_make_string (const char *value)
    UNIT is an ulong<64> PVM value specifying the unit of the offset,
    in terms of the basic unit which is the bit.  */
 
-pvm_val pvm_make_offset (pvm_val magnitude, pvm_val unit)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_offset (pvm_val magnitude, pvm_val unit);
 
 /* Make an array PVM value.
 
@@ -249,8 +230,7 @@ pvm_val pvm_make_offset (pvm_val magnitude, pvm_val unit)
 
    The elements in the created array are initialized to PVM_NULL.  */
 
-pvm_val pvm_make_array (pvm_val nelem, pvm_val type)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_array (pvm_val nelem, pvm_val type);
 
 /* Make a struct PVM value.
 
@@ -265,96 +245,73 @@ pvm_val pvm_make_array (pvm_val nelem, pvm_val type)
    The fields and methods in the created struct are initialized to
    PVM_NULL.  */
 
-pvm_val pvm_make_struct (pvm_val nfields, pvm_val nmethods, pvm_val type)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_struct (pvm_val nfields, pvm_val nmethods, pvm_val type);
 
 /* Make a closure PVM value.
    PROGRAM is a PVM program that conforms the body of the closure.  */
 
-pvm_val pvm_make_cls (pvm_program program)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_cls (pvm_program program);
 
 /* Compare two PVM values.
 
    Returns 1 if they match, 0 otherwise.  */
 
-int pvm_val_equal_p (pvm_val val1, pvm_val val2)
-  __attribute__ ((visibility ("hidden")));
+int pvm_val_equal_p (pvm_val val1, pvm_val val2);
 
 /*** PVM values.  ***/
 
-void pvm_print_string (pvm_val string)
-  __attribute__ ((visibility ("hidden")));
+void pvm_print_string (pvm_val string);
 
-pvm_val pvm_ref_struct (pvm_val sct, pvm_val name)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_ref_struct (pvm_val sct, pvm_val name);
 
-int pvm_set_struct (pvm_val sct, pvm_val name, pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+int pvm_set_struct (pvm_val sct, pvm_val name, pvm_val val);
 
-pvm_val pvm_get_struct_method (pvm_val sct, const char *name)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_get_struct_method (pvm_val sct, const char *name);
 
-pvm_val pvm_make_integral_type (pvm_val size, pvm_val signed_p)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_integral_type (pvm_val size, pvm_val signed_p);
 
-pvm_val pvm_make_string_type (void)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_string_type (void);
 
-pvm_val pvm_make_any_type (void)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_any_type (void);
 
-pvm_val pvm_make_array_type (pvm_val type, pvm_val bound)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_array_type (pvm_val type, pvm_val bound);
 
 pvm_val pvm_make_struct_type (pvm_val nfields, pvm_val name,
-                              pvm_val *fnames, pvm_val *ftypes)
-  __attribute__ ((visibility ("hidden")));
+                              pvm_val *fnames, pvm_val *ftypes);
 
-pvm_val pvm_make_offset_type (pvm_val base_type, pvm_val unit)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_offset_type (pvm_val base_type, pvm_val unit);
 pvm_val pvm_make_closure_type (pvm_val rtype, pvm_val nargs,
-                               pvm_val *atypes)
-  __attribute__ ((visibility ("hidden")));
+                               pvm_val *atypes);
 
-pvm_val pvm_dup_type (pvm_val type)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_dup_type (pvm_val type);
 
-pvm_val pvm_typeof (pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_typeof (pvm_val val);
 
-int pvm_type_equal_p (pvm_val type1, pvm_val type2)
-  __attribute__ ((visibility ("hidden")));
+int pvm_type_equal_p (pvm_val type1, pvm_val type2);
 
-pvm_program pvm_val_cls_program (pvm_val cls)
-  __attribute__ ((visibility ("hidden")));
+pvm_program pvm_val_cls_program (pvm_val cls);
 
 /* Return the size of VAL, in bits.  */
 
-uint64_t pvm_sizeof (pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+uint64_t pvm_sizeof (pvm_val val);
 
 /* For strings, arrays and structs, return the number of
    elements/fields stored, as an unsigned 64-bits long.  Return 1
    otherwise.  */
 
-pvm_val pvm_elemsof (pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_elemsof (pvm_val val);
 
 /* Return the mapper function for the given value, and the writer
    function.  If the value is not mapped, return PVM_NULL.  */
 
-pvm_val pvm_val_mapper (pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_val_mapper (pvm_val val);
 
-pvm_val pvm_val_writer (pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_val_writer (pvm_val val);
 
 /* Return a PVM value for an exception with the given CODE, MESSAGE
    and EXIT_STATUS.  */
 
-pvm_val pvm_make_exception (int code, char *message, int exit_status)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_make_exception (int code, char *message, int exit_status);
 
 
 /* **************** The Run-Time Environment ****************  */
@@ -398,8 +355,7 @@ typedef struct pvm_env *pvm_env;  /* Struct defined in 
pvm-env.c */
    registered in this environment.  If HINT is 0 it indicates that we
    can't provide an estimation.  */
 
-pvm_env pvm_env_new (int hint)
-  __attribute__ ((visibility ("hidden")));
+pvm_env pvm_env_new (int hint);
 
 /* Push a new empty frame to ENV and return the modified run-time
    environment.
@@ -408,41 +364,35 @@ pvm_env pvm_env_new (int hint)
    in the frame.  If HINT is 0, it indicates the number can't be
    estimated at all.  */
 
-pvm_env pvm_env_push_frame (pvm_env env, int hint)
-  __attribute__ ((visibility ("hidden")));
+pvm_env pvm_env_push_frame (pvm_env env, int hint);
 
 /* Pop a frame from ENV and return the modified run-time environment.
    The popped frame will eventually be garbage-collected if there are
    no more references to it.  Trying to pop the top-level frame is an
    error.  */
 
-pvm_env pvm_env_pop_frame (pvm_env env)
-  __attribute__ ((visibility ("hidden")));
+pvm_env pvm_env_pop_frame (pvm_env env);
 
 /* Create a new variable in the current frame of ENV, whose value is
    VAL.  */
 
-void pvm_env_register (pvm_env env, pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+void pvm_env_register (pvm_env env, pvm_val val);
 
 /* Return the value for the variable occupying the position BACK, OVER
    in the run-time environment ENV.  Return PVM_NULL if the variable
    is not found.  */
 
-pvm_val pvm_env_lookup (pvm_env env, int back, int over)
-  __attribute__ ((visibility ("hidden")));
+pvm_val pvm_env_lookup (pvm_env env, int back, int over);
 
 /* Set the value of the variable occupying the position BACK, OVER in
    the run-time environment ENV to VAL.  */
 
-void pvm_env_set_var (pvm_env env, int back, int over, pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+void pvm_env_set_var (pvm_env env, int back, int over, pvm_val val);
 
 /* Return 1 if the given run-time environment ENV contains only one
    frame.  Return 0 otherwise.  */
 
-int pvm_env_toplevel_p (pvm_env env)
-  __attribute__ ((visibility ("hidden")));
+int pvm_env_toplevel_p (pvm_env env);
 
 /*** Other Definitions.  ***/
 
@@ -537,18 +487,15 @@ typedef struct pvm *pvm;
 
 /* Initialize a new Poke Virtual Machine and return it.  */
 
-pvm pvm_init (void)
-  __attribute__ ((visibility ("hidden")));
+pvm pvm_init (void);
 
 /* Finalize a Poke Virtual Machine, freeing all used resources.  */
 
-void pvm_shutdown (pvm pvm)
-  __attribute__ ((visibility ("hidden")));
+void pvm_shutdown (pvm pvm);
 
 /* Get the current run-time environment of PVM.  */
 
-pvm_env pvm_get_env (pvm pvm)
-  __attribute__ ((visibility ("hidden")));
+pvm_env pvm_get_env (pvm pvm);
 
 /* Run a PVM program in a virtual machine.
 
@@ -560,8 +507,7 @@ pvm_env pvm_get_env (pvm pvm)
 
 enum pvm_exit_code pvm_run (pvm vm,
                             pvm_program program,
-                            pvm_val *res)
-  __attribute__ ((visibility ("hidden")));
+                            pvm_val *res);
 
 /* Get/set the current byte endianness of a virtual machine.
 
@@ -571,11 +517,9 @@ enum pvm_exit_code pvm_run (pvm vm,
    ENDIAN should be one of IOS_ENDIAN_LSB (for little-endian) or
    IOS_ENDIAN_MSB (for big-endian).  */
 
-enum ios_endian pvm_endian (pvm pvm)
-  __attribute__ ((visibility ("hidden")));
+enum ios_endian pvm_endian (pvm pvm);
 
-void pvm_set_endian (pvm pvm, enum ios_endian endian)
-  __attribute__ ((visibility ("hidden")));
+void pvm_set_endian (pvm pvm, enum ios_endian endian);
 
 /* Get/set the current negative encoding of a virtual machine.
 
@@ -584,11 +528,9 @@ void pvm_set_endian (pvm pvm, enum ios_endian endian)
 
    NENC should be one of the IOS_NENC_* values defined in ios.h */
 
-enum ios_nenc pvm_nenc (pvm pvm)
-  __attribute__ ((visibility ("hidden")));
+enum ios_nenc pvm_nenc (pvm pvm);
 
-void pvm_set_nenc (pvm pvm, enum ios_nenc nenc)
-  __attribute__ ((visibility ("hidden")));
+void pvm_set_nenc (pvm pvm, enum ios_nenc nenc);
 
 /* Get/set the pretty-print flag in a virtual machine.
 
@@ -596,11 +538,9 @@ void pvm_set_nenc (pvm pvm, enum ios_nenc nenc)
    methods when printing struct PVM values.  This requires the
    presence of a compiler associated with the VM.  */
 
-int pvm_pretty_print (pvm pvm)
-  __attribute__ ((visibility ("hidden")));
+int pvm_pretty_print (pvm pvm);
 
-void pvm_set_pretty_print (pvm pvm, int pretty_print_p)
-  __attribute__ ((visibility ("hidden")));
+void pvm_set_pretty_print (pvm pvm, int pretty_print_p);
 
 /* Get/set the output parameters configured in a virtual machine.
 
@@ -622,40 +562,28 @@ void pvm_set_pretty_print (pvm pvm, int pretty_print_p)
    array PVM values.  A value of 0 indicates to print all the elements
    of arrays.  */
 
-int pvm_obase (pvm vm)
-  __attribute__ ((visibility ("hidden")));
+int pvm_obase (pvm vm);
 
-void pvm_set_obase (pvm vm, int obase)
-  __attribute__ ((visibility ("hidden")));
+void pvm_set_obase (pvm vm, int obase);
 
-enum pvm_omode pvm_omode (pvm vm)
-  __attribute__ ((visibility ("hidden")));
+enum pvm_omode pvm_omode (pvm vm);
 
-void pvm_set_omode (pvm vm, enum pvm_omode omode)
-  __attribute__ ((visibility ("hidden")));
+void pvm_set_omode (pvm vm, enum pvm_omode omode);
 
-int pvm_omaps (pvm vm)
-  __attribute__ ((visibility ("hidden")));
+int pvm_omaps (pvm vm);
 
-void pvm_set_omaps (pvm vm, int omaps)
-  __attribute__ ((visibility ("hidden")));
+void pvm_set_omaps (pvm vm, int omaps);
 
-unsigned int pvm_oindent (pvm vm)
-  __attribute__ ((visibility ("hidden")));
+unsigned int pvm_oindent (pvm vm);
 
-void pvm_set_oindent (pvm vm, unsigned int oindent)
-  __attribute__ ((visibility ("hidden")));
+void pvm_set_oindent (pvm vm, unsigned int oindent);
 
-unsigned int pvm_odepth (pvm vm)
-  __attribute__ ((visibility ("hidden")));
+unsigned int pvm_odepth (pvm vm);
 
-void pvm_set_odepth (pvm vm, unsigned int odepth)
-  __attribute__ ((visibility ("hidden")));
+void pvm_set_odepth (pvm vm, unsigned int odepth);
 
-unsigned int pvm_oacutoff (pvm vm)
-  __attribute__ ((visibility ("hidden")));
-void pvm_set_oacutoff (pvm vm, unsigned int cutoff)
-  __attribute__ ((visibility ("hidden")));
+unsigned int pvm_oacutoff (pvm vm);
+void pvm_set_oacutoff (pvm vm, unsigned int cutoff);
 
 /* Get/set the compiler associated to a virtual machine.
 
@@ -667,28 +595,23 @@ void pvm_set_oacutoff (pvm vm, unsigned int cutoff)
 
 typedef struct pkl_compiler *pkl_compiler;
 
-pkl_compiler pvm_compiler (pvm vm)
-  __attribute__ ((visibility ("hidden")));
+pkl_compiler pvm_compiler (pvm vm);
 
-void pvm_set_compiler (pvm vm, pkl_compiler compiler)
-  __attribute__ ((visibility ("hidden")));
+void pvm_set_compiler (pvm vm, pkl_compiler compiler);
 
 /* The following function is to be used in pvm.jitter, because the
    system `assert' may expand to a macro and is therefore
    non-wrappeable.  */
 
-void pvm_assert (int expression)
-  __attribute__ ((visibility ("hidden")));
+void pvm_assert (int expression);
 
 /* This is defined in the late-c block in pvm.jitter.  */
 
-void pvm_handle_signal (int signal_number)
-  __attribute__ ((visibility ("hidden")));
+void pvm_handle_signal (int signal_number);
 
 /* Call the pretty printer of the given value VAL.  */
 
-int pvm_call_pretty_printer (pvm vm, pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+int pvm_call_pretty_printer (pvm vm, pvm_val val);
 
 /* Print a PVM value.
 
@@ -722,13 +645,11 @@ int pvm_call_pretty_printer (pvm vm, pvm_val val)
 #define PVM_PRINT_F_MAPS   1
 #define PVM_PRINT_F_PPRINT 2
 
-void pvm_print_val (pvm vm, pvm_val val)
-  __attribute__ ((visibility ("hidden")));
+void pvm_print_val (pvm vm, pvm_val val);
 
 void pvm_print_val_with_params (pvm vm, pvm_val val,
                                 int depth,int mode, int base,
                                 int indent, int acutoff,
-                                uint32_t flags)
-  __attribute__ ((visibility ("hidden")));
+                                uint32_t flags);
 
 #endif /* ! PVM_H */
-- 
2.28.0



reply via email to

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