Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
[[ Bug 19166 ]] Update Mac builds to use libc++
Browse files Browse the repository at this point in the history
This patch changes the configuration of the Mac builds so that they
are compiled using libc++, using deployment target 10.9 and SDK
10.9.

Additionally, it patches a use of a null PMPrinter in one of the APIs
which is believed to cause a failure of a full Mac distribution
build.
  • Loading branch information
runrevmark committed Feb 9, 2017
1 parent 62c0373 commit a314c1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions config/mac.gypi
Expand Up @@ -24,12 +24,13 @@
'SHARED_PRECOMPS_DIR': '$(OBJROOT)/Precompiled/$(CURRENT_ARCH)',
'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'NO',
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'MACOSX_DEPLOYMENT_TARGET': '10.6',
'MACOSX_DEPLOYMENT_TARGET': '10.9',
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',
'COPY_PHASE_STRIP': 'NO',
'STRIP_INSTALLED_PRODUCT': 'NO',
'CLANG_LINK_OBJC_RUNTIME': 'NO',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++0x',
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
'CLANG_CXX_LIBRARY': 'libc++'
},

'target_defaults':
Expand Down
7 changes: 5 additions & 2 deletions engine/src/osxprinter.cpp
Expand Up @@ -708,7 +708,9 @@ void MCMacOSXPrinter::SetDerivedProperties(void)
{
PMRect t_pm_page_rect, t_pm_paper_rect;
PDEBUG(stderr, "SetProperties: PMGetAdjustedPaperRect\n");
if (PMGetAdjustedPaperRect(m_page_format, &t_pm_paper_rect) == noErr && PMGetAdjustedPageRect(m_page_format, &t_pm_page_rect) == noErr)
if (m_page_format != nullptr &&
PMGetAdjustedPaperRect(m_page_format, &t_pm_paper_rect) == noErr &&
PMGetAdjustedPageRect(m_page_format, &t_pm_page_rect) == noErr)
{
int4 t_left;
t_left = (int4)floor(t_pm_page_rect . left - t_pm_paper_rect . left);
Expand All @@ -733,7 +735,8 @@ void MCMacOSXPrinter::SetDerivedProperties(void)

PDEBUG(stderr, "SetProperties: PMPrinterGetDescriptionURL\n");
CFURLRef t_ppd_url = NULL;
if (PMPrinterCopyDescriptionURL(m_printer, kPMPPDDescriptionType, &t_ppd_url) == noErr)
if (m_printer != nullptr &&
PMPrinterCopyDescriptionURL(m_printer, kPMPPDDescriptionType, &t_ppd_url) == noErr)
{
char *t_ppd_file;
t_ppd_file = osx_cfstring_to_cstring(CFURLCopyFileSystemPath(t_ppd_url, kCFURLPOSIXPathStyle), true);
Expand Down

0 comments on commit a314c1b

Please sign in to comment.