Ticket #49449: osx108-no-cxx11.patch

File osx108-no-cxx11.patch, 2.3 KB (added by howarth.at.macports@…, 9 years ago)

patch to avoid unsupported c++11 code on 10.8 or earlier

  • layer2/CifMoleculeReader.cpp

     
    21062106  }
    21072107
    21082108  const char * filename = NULL;
     2109#ifndef _PYMOL_NO_CXX11
    21092110  auto cif = std::make_shared<cif_file>(filename, st);
     2111#else
     2112  cif_file _cif_stack(filename, st);
     2113  auto cif = &_cif_stack;
     2114#endif
    21102115
    21112116  for (auto it = cif->datablocks.begin(); it != cif->datablocks.end(); ++it) {
    21122117    ObjectMolecule * obj = ObjectMoleculeReadCifData(G, it->second, discrete);
     
    21172122      continue;
    21182123    }
    21192124
    2120 #ifndef _PYMOL_NOPY
     2125#if !defined(_PYMOL_NOPY) && !defined(_PYMOL_NO_CXX11)
    21212126    // we only provide access from the Python API so far
    21222127    if (SettingGetGlobal_b(G, cSetting_cif_keepinmemory)) {
    21232128      obj->m_cifdata = it->second;
  • layer2/ObjectMolecule.cpp

     
    1256112561  VLAFreeP(I->DiscreteAtmToIdx);
    1256212562  VLAFreeP(I->DiscreteCSet);
    1256312563  VLAFreeP(I->CSet);
     12564#ifndef _PYMOL_NO_CXX11
    1256412565  I->m_ciffile.reset(); // free data
     12566#endif
    1256512567
    1256612568  {
    1256712569    int nAtom = I->NAtom;
  • layer2/ObjectMolecule.h

     
    8686  int RepVisCache;     /* for transient storage during updates */
    8787
    8888  // for reporting available assembly ids after mmCIF loading - SUBJECT TO CHANGE
     89#ifndef _PYMOL_NO_CXX11
    8990  std::shared_ptr<cif_file> m_ciffile;
     91#endif
    9092  const cif_data * m_cifdata;
    9193
    9294  // methods
  • setup.py

     
    213213            ("NO_MMLIBS",None),
    214214            ]
    215215
     216    if sys.platform == 'darwin':
     217        import platform
     218        if int(platform.mac_ver()[0].split('.')[1]) < 9:
     219            # OS X <= 10.8, will still use some C++11 features
     220            # like the "auto" keyword, but excludes features which
     221            # depend on the C++11 std library.
     222            def_macros += [
     223                ('_PYMOL_NO_CXX11', None),
     224            ]
     225
    216226    try:
    217227        import numpy
    218228        inc_dirs += [