chyyuu / distorm

Automatically exported from code.google.com/p/distorm
GNU General Public License v3.0
0 stars 0 forks source link

_DLL macro conflict with MSVC + static libdistorm + dynamic runtime #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

the preprocessor symbol _DLL is currently used to define whether libdistorm3 
functions should be exported or not.

src/config.h:117:
  /* If the library isn't compiled as a .DLL don't export functions. */
  #ifndef _DLL
  #undef _DLLEXPORT_
  #define _DLLEXPORT_
  #endif

This results in a conflict when using distorm under MSVC library and linking 
with MSVCRT, because then _DLL is defined as follows:

_DLL    -    Defined when /MD or /MDd (Multithreaded DLL) is specified.
             <http://msdn.microsoft.com/en-us/library/b0084kay(v=VS.100).aspx>

Unfortunately there is probably no way to really infer whether the sources are 
compiled as a part of static .lib or into a .dll AFAIK.

But I think you should at least use a different macro, like LIBDISTORM_EXPORTS, 
instead of _DLL. Symbol names beginning with an underscore like this are often 
deemed reserved anyway.

Original issue reported on code.google.com by Yir...@gmail.com on 21 Feb 2011 at 11:18

GoogleCodeExporter commented 9 years ago
Thanks, will do that.

Original comment by distorm@gmail.com on 22 Feb 2011 at 11:11

GoogleCodeExporter commented 9 years ago

Original comment by distorm@gmail.com on 16 Apr 2011 at 1:16

GoogleCodeExporter commented 9 years ago

Original comment by distorm@gmail.com on 22 Apr 2011 at 11:32

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r169.

Original comment by distorm@gmail.com on 22 Apr 2011 at 11:33