~vcs-imports/libiconv/trunk

« back to all changes in this revision

Viewing changes to woe32dll/export.h

  • Committer: Bruno Haible
  • Date: 2023-09-07 11:50:13 UTC
  • Revision ID: git-v1:999f8b33824194e14ea2b8be0c1089a53f0bb7e6
Sync woe32dll/export.h with GNU libunistring and GNU gettext.

* woe32dll/export.h: Update comments.
(IMP): Define correctly for 64-bit Windows platforms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Exporting symbols from Cygwin shared libraries.
2
 
   Copyright (C) 2006, 2011-2018 Free Software Foundation, Inc.
 
1
/* Exporting symbols from Windows shared libraries.
 
2
   Copyright (C) 2006, 2011-2023 Free Software Foundation, Inc.
3
3
   Written by Bruno Haible <bruno@clisp.org>, 2006.
4
4
 
5
5
   This program is free software; you can redistribute it and/or modify
16
16
   License along with this program; see the file COPYING.LIB.  If not,
17
17
   see <https://www.gnu.org/licenses/>.  */
18
18
 
19
 
/* There are four ways to build shared libraries on Cygwin:
 
19
/* There are four ways to build shared libraries on Windows:
20
20
 
21
21
   - Export only functions, no variables.
22
22
     This has the drawback of severely affecting the programming style in use.
54
54
       2. the library sources are contained in one directory, making it easy
55
55
          to define a -DBUILDING_LIBXYZ flag for the library.
56
56
     Example:
57
 
         #ifdef BUILDING_LIBASPRINTF
58
 
         #define LIBASPRINTF_DLL_EXPORTED __declspec(dllexport)
 
57
         #ifdef BUILDING_LIBICONV
 
58
         #define LIBICONV_DLL_EXPORTED __declspec(dllexport)
59
59
         #else
60
 
         #define LIBASPRINTF_DLL_EXPORTED __declspec(dllimport)
 
60
         #define LIBICONV_DLL_EXPORTED __declspec(dllimport)
61
61
         #endif
62
62
 
63
 
     We use this technique for the libintl and the libasprintf libraries.
 
63
     We use this technique for the libintl and the libiconv libraries.
64
64
 
65
65
   - Define a macro that expands to  __declspec(dllimport)  always, and use
66
66
     it in all header files of the library.  Use an explicit export list for
95
95
#if defined __GNUC__ /* GCC compiler, GNU toolchain */
96
96
 
97
97
 /* IMP(x) is a symbol that contains the address of x.  */
98
 
# define IMP(x) _imp__##x
 
98
# if defined _WIN64 || defined _LP64
 
99
#  define IMP(x) __imp_##x
 
100
# else
 
101
#  define IMP(x) _imp__##x
 
102
# endif
99
103
 
100
104
 /* Ensure that the variable x is exported from the library, and that a
101
105
    pseudo-variable IMP(x) is available.  */