[waffle] waffle vs msvc: Round 1, Fight !!!

Emil Velikov emil.l.velikov at gmail.com
Sun Jun 29 17:05:27 PDT 2014


Hello all,

Another day another long email :)

As usual, a list of issues, possible solutions, and my personal
preference for each. At the end I have tried to assign a priority for
most.

Any input would be greatly appreciated.

Highlights:

General (nitbits):
 * C "Hello world" does not work OOTB with VC12 :)
 ** Have to switch the platform toolset to v120_xp, as the default
v120 complains about missing headers, libraries... (SDKDDKVer.h...),

 * Compiling ninja - fails due to the missing toolset.
 ** Planning to use VC for now.

Jose are you having similar experience with VC12 ? Pardon but I'm
using VC12 for the first time, and the documentation out there is
rather... :\


Build system related:
 * Tests fail to build due to the missing toolset (+ others?)
 Possible fix(es)
 ** if (windows && !mingw) hardcode generator and toolset across whole
of waffle endif ()

 * cmake does not find some headers and libs - GL/gl.h windows.h opengl32.lib
 Possible fix(es)
 ** Hardcode the libname, and ignore the headers' location as they
should just work (tm)

POSIX only
 * getopt (utils/wflinfo, examples/gl_basic) - reuse one of the
following (license implications?)
 Current implementations
 ** http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/pkgtools/libnbcompat/files/getopt.c
(BSD 3-clause)
 ** http://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/getopt.c
(unknown + BSD 2-clause)
 Leaning towards reusing the NetBSD's implementation.

 * pthreads - reuse one of the following (license implications?)
 Current implementations
 ** http://locklessinc.com/downloads/winpthreads.h (BSD 3-clause)
 ** https://www.sourceware.org/pthreads-win32/ (GNU Lesser GPL)
 ** http://cgit.freedesktop.org/mesa/mesa/tree/include/c11/threads_win32.h
(Boost Software License, Version 1.0)
 ** http://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-libraries/winpthreads
(unknown [2]) - allegedly uses undocumented Windows API's
 Leaning towards reusing locklessinc's implementation.

Other
 * Symbols must be identically annotated in both declaration and
definition (i.e. we need to bring WAFFLEAPI back into the public
header ?)
 Possible fix(es)
 ** Pre-parse the header and ship one without the keyword ?
 ** Define an empty WAFFLEAPI when using MSVC and use "module
definition file (.def)"
 Leaning towards using a .def

 * struct waffle_* {} wfl - not strictly supported by C99 ?
http://stackoverflow.com/questions/755305/empty-structure-in-c
 MSVC message "C requires that a struct or union has at least one member"
 Possible fix(es)
 ** Add a dummy param inside the struct. We do not rely on the struct
having a zero size but use it as a pointer to the start of the parent
struct ?

Chad, does the last point make sense or did I completely miss out the
plot while reading through the internal API ?


Priority (high to low)
 * struct waffle_* {} wfl
 * pthreads
 * getopt
 * WAFFLEAPI
 * everything else


Cheers,
Emil

The unknown licenses
[1]
 * Copyright (c) 2002 Todd C. Miller <Todd.Miller at courtesan.com>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 * Sponsored in part by the Defense Advanced Research Projects
 * Agency (DARPA) and Air Force Research Laboratory, Air Force
 * Materiel Command, USAF, under agreement number F39502-99-1-0512.

[2]
   Copyright (c) 2011 mingw-w64 project

   Permission is hereby granted, free of charge, to any person obtaining a
   copy of this software and associated documentation files (the "Software"),
   to deal in the Software without restriction, including without limitation
   the rights to use, copy, modify, merge, publish, distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so, subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   DEALINGS IN THE SOFTWARE.


More information about the waffle mailing list