Show
Ignore:
Timestamp:
03/22/06 18:47:01 (4 years ago)
Author:
ahu
Message:

big bag 'o Solaris fixes! (partially sent by Juergen Georgi)
pdns_recursor not only compiles (although you still need LIBS="-lnsl -lsocket -lresolv") but works too
Fixes the famous "‘init_priority’ attribute is not supported on this platform"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/dnsparser.hh

    r579 r612  
    180180  { 
    181181    if(f) 
    182       typemap[make_pair(cl,ty)]=f; 
     182      getTypemap()[make_pair(cl,ty)]=f; 
    183183    if(z) 
    184       zmakermap[make_pair(cl,ty)]=z; 
    185  
    186     namemap[make_pair(cl,ty)]=name; 
     184      getZmakermap()[make_pair(cl,ty)]=z; 
     185 
     186    getNamemap()[make_pair(cl,ty)]=name; 
    187187  } 
    188188 
    189189  static uint16_t TypeToNumber(const string& name) 
    190190  { 
    191     for(namemap_t::const_iterator i=namemap.begin(); i!=namemap.end();++i) 
     191    for(namemap_t::const_iterator i=getNamemap().begin(); i!=getNamemap().end();++i) 
    192192      if(!strcasecmp(i->second.c_str(), name.c_str())) 
    193193        return i->first.second; 
     
    198198  static const string NumberToType(uint16_t num) 
    199199  { 
    200     if(!namemap.count(make_pair(1,num))) 
     200    if(!getNamemap().count(make_pair(1,num))) 
    201201      return "#" + lexical_cast<string>(num); 
    202202      //      throw runtime_error("Unknown DNS type with numerical id "+lexical_cast<string>(num)); 
    203     return namemap[make_pair(1,num)]; 
     203    return getNamemap()[make_pair(1,num)]; 
    204204  } 
    205205 
     
    210210protected: 
    211211  typedef std::map<std::pair<uint16_t, uint16_t>, makerfunc_t* > typemap_t; 
    212   static typemap_t typemap; 
    213  
    214212  typedef std::map<std::pair<uint16_t, uint16_t>, zmakerfunc_t* > zmakermap_t; 
    215   static zmakermap_t zmakermap; 
    216  
    217213  typedef std::map<std::pair<uint16_t, uint16_t>, string > namemap_t; 
    218   static namemap_t namemap; 
     214 
     215  static typemap_t& getTypemap(); 
     216  static namemap_t& getNamemap(); 
     217  static zmakermap_t& getZmakermap(); 
    219218}; 
    220219