[libqb] [PATCH 5/6] Merge some portability changes from the mingw branch