#35 NO_GLU

closed
nobody
None
7
2012-09-15
2010-03-24
No

Since GLU is deprecated, there should be an option to skip GLU. For example, wrapping the glu.h include section with #ifndef NO_GLU / #endif

Discussion

  • Nigel Stewart

    Nigel Stewart - 2010-03-26

    I agree that this is needed.

     
  • Nigel Stewart

    Nigel Stewart - 2010-03-26

    define GLEW_NO_GLU ?

     
  • Borislav Trifonov

    As a possibility, these are the modifications I made:

    glew.h:

    Grouped the defines needed for glu.h in one block and put in an ifndef (decided to use NO_GLU instead of USE_GLU to prevent backwards compatibility issues):

    ifndef NO_GLU

    ifndef GLAPI

    if defined(MINGW32) || defined(CYGWIN)

    define GLAPI extern

    endif

    endif

    / <winnt.h> /

    ifndef CALLBACK

    define GLEW_CALLBACK_DEFINED

    if defined(MINGW32) || defined(CYGWIN)

    define CALLBACK attribute ((stdcall))

    elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)

    define CALLBACK __stdcall

    else

    define CALLBACK

    endif

    endif

    / <ctype.h> /

    if (defined(_MSC_VER) || defined(BORLANDC)) && !defined(_WCHAR_T_DEFINED)

    typedef unsigned short wchar_t;

    define _WCHAR_T_DEFINED

    endif

    endif

    This leaves the defines needed for gl.h:

    / <stddef.h> /

    if !defined(_W64)

    if !defined(__midl) && (defined(X86) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300

    define _W64 __w64

    else

    define _W64

    endif

    endif

    if !defined(PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T)

    ifdef _WIN64

    typedef __int64 ptrdiff_t;

    else

    typedef _W64 int ptrdiff_t;

    endif

    define _PTRDIFF_T_DEFINED

    define PTRDIFF_T

    endif

    ifndef GLAPI

    if defined(MINGW32) || defined(CYGWIN)

    define GLAPI extern

    else

    define GLAPI WINGDIAPI

    endif

    endif

    ifndef GLAPIENTRY

    define GLAPIENTRY APIENTRY

    endif

    Same with the glu.h include blocks:

    ifndef NO_GLU

    / <glu.h> /

    ifndef GLAPI

    define GLAPI extern

    endif

    ifndef GLAPIENTRY

    define GLAPIENTRY

    endif

    endif

    and:

    ifndef NO_GLU

    / this is where we can safely include GLU /

    if defined(APPLE) && defined(MACH)

    include <OpenGL glu.h="">

    else

    include <GL glu.h="">

    endif

    endif

    visualinfo.c:

    ifndef NO_GLU

    fprintf(file, "GLU version string: %s\n", gluGetString(GLU_VERSION));
    fprintf(file, "GLU extensions (GLU_): \n");
    PrintExtensions((char*)gluGetString(GLU_EXTENSIONS));

    endif

     
  • Nigel Stewart

    Nigel Stewart - 2010-03-26

    If possible attach a .diff using svn diff. This seems to be turning into a broader issue than I really bargained for. :-)

     
  • Nigel Stewart

    Nigel Stewart - 2010-03-26

    Works for Linux, perhaps not for windows

     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).