Changes between Version 5 and Version 6 of Ticket #52210, comment 9


Ignore:
Timestamp:
Nov 2, 2016, 11:59:46 AM (8 years ago)
Author:
mojca (Mojca Miklavec)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #52210, comment 9

    v5 v6  
    120120}}}
    121121is 10.7+ only (I'm not sure how this is properly handled when compiled against an earlier SDK).
     122
     123Commenting out the problematic line leads to
     124{{{
     125  CC     build/SDL_cocoaopengl.lo
     126/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:157:61: error: use of undeclared identifier 'NSAppKitVersionNumber10_6'; did you mean 'NSAppKitVersionNumber'?
     127    SDL_bool lion_or_later = floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6;
     128                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~
     129                                                            NSAppKitVersionNumber
     130/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:21:28: note: 'NSAppKitVersionNumber' declared here
     131APPKIT_EXTERN const double NSAppKitVersionNumber;
     132                           ^
     133/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:180:48: error: use of undeclared identifier 'NSOpenGLProfileVersionLegacy'
     134        NSOpenGLPixelFormatAttribute profile = NSOpenGLProfileVersionLegacy;
     135                                               ^
     136/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:182:23: error: use of undeclared identifier 'NSOpenGLProfileVersion3_2Core'
     137            profile = NSOpenGLProfileVersion3_2Core;
     138                      ^
     139/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:184:21: error: use of undeclared identifier 'NSOpenGLPFAOpenGLProfile'
     140        attr[i++] = NSOpenGLPFAOpenGLProfile;
     141                    ^
     142/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:333:33: warning: instance method '-convertRectToBacking:' not found (return type defaults to 'id') [-Wobjc-method-access]
     143        viewport = [contentView convertRectToBacking:viewport];
     144                                ^~~~~~~~~~~~~~~~~~~~
     145/System/Library/Frameworks/AppKit.framework/Headers/NSView.h:122:12: note: receiver is instance of class declared here
     146@interface NSView : NSResponder
     147           ^
     148/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:333:18: error: assigning to 'NSRect' (aka 'struct CGRect') from incompatible type 'id'
     149        viewport = [contentView convertRectToBacking:viewport];
     150                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1511 warning and 5 errors generated.
     152make: *** [build/SDL_cocoaopengl.lo] Error 1
     153}}}
     154thrown by
     155{{{
     156#!objc
     157    /* This gives us the correct viewport for a Retina-enabled view, only
     158     * supported on 10.7+. */
     159    if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
     160        viewport = [contentView convertRectToBacking:viewport];
     161    }
     162}}}
     163Commenting out the assignment leads to
     164{{{
     165  CC     build/SDL_cocoaopengl.lo
     166/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:157:61: error: use of undeclared identifier 'NSAppKitVersionNumber10_6'; did you mean 'NSAppKitVersionNumber'?
     167    SDL_bool lion_or_later = floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6;
     168                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~
     169                                                            NSAppKitVersionNumber
     170/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:21:28: note: 'NSAppKitVersionNumber' declared here
     171APPKIT_EXTERN const double NSAppKitVersionNumber;
     172                           ^
     173/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:180:48: error: use of undeclared identifier 'NSOpenGLProfileVersionLegacy'
     174        NSOpenGLPixelFormatAttribute profile = NSOpenGLProfileVersionLegacy;
     175                                               ^
     176/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:182:23: error: use of undeclared identifier 'NSOpenGLProfileVersion3_2Core'
     177            profile = NSOpenGLProfileVersion3_2Core;
     178                      ^
     179/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaopengl.m:184:21: error: use of undeclared identifier 'NSOpenGLPFAOpenGLProfile'
     180        attr[i++] = NSOpenGLPFAOpenGLProfile;
     181                    ^
     1824 errors generated.
     183make: *** [build/SDL_cocoaopengl.lo] Error 1
     184}}}
     185thrown by
     186{{{
     187SDL_bool lion_or_later = floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6;
     188...
     189/* specify a profile if we're on Lion (10.7) or later. */
     190if (lion_or_later) {
     191    NSOpenGLPixelFormatAttribute profile = NSOpenGLProfileVersionLegacy;
     192    if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_CORE) {
     193        profile = NSOpenGLProfileVersion3_2Core;
     194    }
     195    attr[i++] = NSOpenGLPFAOpenGLProfile;
     196    attr[i++] = profile;
     197}
     198}}}
     199which can temporary be replaced by
     200{{{
     201SDL_bool lion_or_later = false;
     202}}}
     203and commenting out the block that asks for Lion.
     204
     205Then the same story repeats with
     206{{{
     207  CC     build/SDL_cocoavideo.lo
     208/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoavideo.m:153:59: error: use of undeclared identifier 'NSAppKitVersionNumber10_6'; did you mean 'NSAppKitVersionNumber'?
     209    data->allow_spaces = ((floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) && SDL_GetHintBoolean(SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES, SDL_TRUE));
     210                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~
     211                                                          NSAppKitVersionNumber
     212/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:21:28: note: 'NSAppKitVersionNumber' declared here
     213APPKIT_EXTERN const double NSAppKitVersionNumber;
     214                           ^
     215/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoavideo.m:156:65: error: use of undeclared identifier 'NSAppKitVersionNumber10_6'; did you mean 'NSAppKitVersionNumber'?
     216    data->screensaver_use_iopm = floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6;
     217                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
     218                                                                NSAppKitVersionNumber
     219/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:21:28: note: 'NSAppKitVersionNumber' declared here
     220APPKIT_EXTERN const double NSAppKitVersionNumber;
     221                           ^
     2222 errors generated.
     223make: *** [build/SDL_cocoavideo.lo] Error 1
     224}}}