[Lldb-commits] [lldb] 57ebfea - [lldb] Surround LLDB_API-defining code with #ifndef LLDB_API

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 20 11:51:42 PST 2022


Author: Pavel Labath
Date: 2022-01-20T20:50:35+01:00
New Revision: 57ebfea38c03e5cd2d0677eabd2abf761b336097

URL: https://github.com/llvm/llvm-project/commit/57ebfea38c03e5cd2d0677eabd2abf761b336097
DIFF: https://github.com/llvm/llvm-project/commit/57ebfea38c03e5cd2d0677eabd2abf761b336097.diff

LOG: [lldb] Surround LLDB_API-defining code with #ifndef LLDB_API

This enables power-users to annotate lldb api functions with arbitrary
attributes. The motivation for this is being able to build liblldb as a
static library on windows (see discussion on D117564).

This should not be interpreted to mean that building liblldb is
supported in any way, but this does not cause any problems for us, and
can help users who really know what they are doing (or have no other
choice).

Added: 
    

Modified: 
    lldb/include/lldb/API/SBDefines.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/API/SBDefines.h b/lldb/include/lldb/API/SBDefines.h
index d0ee09368d029..ecf1dc34d8c58 100644
--- a/lldb/include/lldb/API/SBDefines.h
+++ b/lldb/include/lldb/API/SBDefines.h
@@ -15,6 +15,7 @@
 #include "lldb/lldb-types.h"
 #include "lldb/lldb-versioning.h"
 
+#ifndef LLDB_API
 #if defined(_WIN32)
 #if defined(LLDB_IN_LIBLLDB)
 #define LLDB_API __declspec(dllexport)
@@ -24,6 +25,7 @@
 #else // defined (_WIN32)
 #define LLDB_API
 #endif
+#endif
 
 // Forward Declarations
 namespace lldb {


        


More information about the lldb-commits mailing list