Changeset: 83f5b8bf06c5 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=83f5b8bf06c5
Modified Files:
        common/options/monet_getopt.h
        common/options/monet_options.mx
Branch: default
Log Message:

Fix exports in options library.
Since libmoptions is a NOINST library and not a shared library, it
should "inherit" the import/export stuff from the shared libraries it
is incorporated into.  We do that thus:
- getopt (if compiled and used by us) is not exported.
- mo_* *is* exported, but since they are basically never imported
  (through the use of a shared library) within MonetDB, we *always*
  export when compiling MonetDB, and *never* outside.  This is checked
  by the MONETDB_RELEASE symbol.


diffs (103 lines):

diff -r f7808916c7e2 -r 83f5b8bf06c5 common/options/monet_getopt.h
--- a/common/options/monet_getopt.h     Fri Jan 14 16:05:13 2011 +0100
+++ b/common/options/monet_getopt.h     Fri Jan 14 17:48:54 2011 +0100
@@ -57,26 +57,13 @@
 extern "C" {
 #endif
 
-#ifndef moptions_export
-/* avoid using "#ifdef WIN32" so that this file does not need our config.h */
-#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
-#ifndef LIBMUTILS
-#define moptions_export extern __declspec(dllimport)
-#else
-#define moptions_export extern __declspec(dllexport)
-#endif
-#else
-#define moptions_export extern
-#endif
-#endif
-
 /* For communication from `getopt' to the caller.
    When `getopt' finds an option that takes an argument,
    the argument value is returned here.
    Also, when `ordering' is RETURN_IN_ORDER,
    each non-option ARGV-element is returned here.  */
 
-       moptions_export char *optarg;
+       extern char *optarg;
 
 /* Index in ARGV of the next element to be scanned.
    This is used for communication to and from the caller
@@ -90,16 +77,16 @@
    Otherwise, `optind' communicates from one call to the next
    how much of ARGV has been scanned so far.  */
 
-       moptions_export int optind;
+       extern int optind;
 
 /* Callers store zero here to inhibit the error message `getopt' prints
    for unrecognized options.  */
 
-       moptions_export int opterr;
+       extern int opterr;
 
 /* Set to an option character which was unrecognized.  */
 
-       moptions_export int optopt;
+       extern int optopt;
 
 #ifndef __need_getopt
 /* Describe the long-named options requested by the application.
@@ -174,30 +161,30 @@
    differences in the consts, in stdlib.h.  To avoid compilation
    errors, only prototype getopt for the GNU C library.  */
 #ifndef HAVE_GETOPT
-       moptions_export int getopt(int __argc__, char *const *__argv__, const 
char *__shortopts);
+       extern int getopt(int __argc__, char *const *__argv__, const char 
*__shortopts);
 #endif
 # else                         /* not __GNU_LIBRARY__ */
 #ifndef HAVE_GETOPT
-       moptions_export int getopt();
+       extern int getopt();
 #endif
 # endif                                /* __GNU_LIBRARY__ */
 
 # ifndef __need_getopt
-       moptions_export int getopt_long(int __argc__, char *const *__argv__, 
const char *__shortopts, const struct option *__longopts, int *__longind);
-       moptions_export int getopt_long_only(int __argc__, char *const 
*__argv__, const char *__shortopts, const struct option *__longopts, int 
*__longind);
+       extern int getopt_long(int __argc__, char *const *__argv__, const char 
*__shortopts, const struct option *__longopts, int *__longind);
+       extern int getopt_long_only(int __argc__, char *const *__argv__, const 
char *__shortopts, const struct option *__longopts, int *__longind);
 
 /* Internal only.  Users should not call this directly.  */
-       moptions_export int _getopt_internal(int __argc__, char *const 
*__argv__, const char *__shortopts, const struct option *__longopts, int 
*__longind, int __long_only);
+       extern int _getopt_internal(int __argc__, char *const *__argv__, const 
char *__shortopts, const struct option *__longopts, int *__longind, int 
__long_only);
 # endif
 #else                          /* not __STDC__ */
 #ifndef HAVE_GETOPT
-       moptions_export int getopt();
+       extern int getopt();
 #endif
 # ifndef __need_getopt
-       moptions_export int getopt_long();
-       moptions_export int getopt_long_only();
+       extern int getopt_long();
+       extern int getopt_long_only();
 
-       moptions_export int _getopt_internal();
+       extern int _getopt_internal();
 # endif
 #endif                         /* __STDC__ */
 
diff -r f7808916c7e2 -r 83f5b8bf06c5 common/options/monet_options.mx
--- a/common/options/monet_options.mx   Fri Jan 14 16:05:13 2011 +0100
+++ b/common/options/monet_options.mx   Fri Jan 14 17:48:54 2011 +0100
@@ -50,7 +50,7 @@
 #ifndef moptions_export
 /* avoid using "#ifdef WIN32" so that this file does not need our config.h */
 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
-#ifndef LIBMOPTIONS
+#ifndef MONETDB_RELEASE                /* assume only defined within MonetDB */
 #define moptions_export extern __declspec(dllimport)
 #else
 #define moptions_export extern __declspec(dllexport)
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to