[Lldb-commits] Remove <windows.h> from lldb-types.h

Greg Clayton gclayton at apple.com
Tue Sep 3 09:47:39 PDT 2013

Looks good.

On Aug 30, 2013, at 10:44 PM, Virgile Bello <virgile.bello at gmail.com> wrote:

> Hello,
> One of the biggest issue with the current MinGW build was that lldb-types included <Windows.h>.
> It leads to slower compile time, but more importantly, due to its monolithic architecture, it was pulling lot of unwanted #defines. This results in various clash (requiring #undef). As an example, this recently resulted in many enum/#define conflicts with llvm's COFF.h.
> On top of that, it was also polluding user code including LLDB since it would in turn include Windows.h, pulling all those unwanted #define, and removing control over how the user might want to include <windows.h> himself (it's controllable through various "pre #define").
> As a result, I tried to remove <windows.h> from lldb-types.h.
> This led to various small refactoring (usually moving things from .h to .cpp, esp. for sockaddr, TimeValue, using LLVM atomic, etc...).
> Also SocketAddress is considered internal only (included only in .cpp, not .h) because it requires system defines (only .h file requiring windows.h).
> I had to get rid of timeval from headers (which is unfortunately defined by winsock2.h in Windows).
> Note that I added two new functions and a constructor in TimeValue: seconds() and nanoseconds(). It doesn't match casing of existing lldb class but I tried to use LLVM's TimeValue function name so that a later transition to LLVM one will be more easy.
> Patch might need some tuning, but it should give you a good idea of what I want to achieve.
> Let me know what you think about it.
> Virgile
> <lldb-remove-windows-h.diff>_______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

More information about the lldb-commits mailing list