anchor.diff:       "    }\n",
        "\n"].
   
  +format_nif_cc_field_unpacker_maptype(DestVar, MsgVar, Field, Defs, Opts) ->
  +    #?gpb_field{name=FName, type={map, KeyType, ValueType}=Type} = Field,
  +    LCFName = to_lower(FName),
  +    ItType = mk_cctype_name(Type, Defs) ++ "::const_iterator",
  +    MapsOrRecords = get_records_or_maps_by_opts(Opts),
  +    split_indent_iolist(
  +      4,
  +      ["{\n",
  +       split_indent_iolist(
  +         4,
  +         case MapsOrRecords of
  +             records ->
  +                 [?f("~s = enif_make_list(env, 0);\n", [DestVar]),
  +                  ?f("int i = 0;\n", [])];
  +             maps ->
  +                 ?f("~s = enif_make_new_map(env);\n", [DestVar])
  +         end),
  +       %% Iterate
  +       ?f("    for (~s it = ~s->~s().begin();\n"
  +          "         it != ~s->~s().end();\n"
  +          "         ++it)\n",
  +          [ItType, MsgVar, LCFName, MsgVar, LCFName]),
  +       "    {\n",
  +       "        ERL_NIF_TERM ek, ev;\n",
  +       %% FIXME
  +       split_indent_iolist(
  +         8,
  +         [format_nif_cc_field_unpacker_by_type("ek", "it->first", KeyType,
  +                                               Defs),
  +          format_nif_cc_field_unpacker_by_type("ev", "it->second", ValueType,
  +                                               Defs),
  +          case MapsOrRecords of
  +              records ->
  +                  ["ERL_NIF_TERM eitem = enif_make_tuple2(env, ek, ev);\n",
  +                   ?f("~s = enif_make_list_cell(env, eitem, ~s);\n",
  +                      [DestVar, DestVar]),
  +                   "++i;\n"];
  +              maps ->
  +                  [?f("enif_make_map_put(env, ~s, ek, ev, &~s);\n",
  +                      [DestVar, DestVar])]
  +          end]),
  +       "    }\n",
  +       "}\n"]).
  +
  +
  +mk_cctype_name({enum,EnumName}, Defs) ->
  +    EPrefix = case is_dotted(EnumName) of
  +                  false -> atom_to_list(EnumName);
  +                  true  -> dot_replace_s(EnumName, "_")
  +              end,
  +    CPkg = get_cc_pkg(Defs),
  +    CPkg ++ "::" ++ EPrefix;
  +mk_cctype_name({msg,MsgName}, Defs) ->
  +    CPkg = get_cc_pkg(Defs),
  +    CPkg ++ "::" ++ dot_replace_s(MsgName, "::");
  +mk_cctype_name({map,KeyType,ValueType}, Defs) ->
  +    CKeyType = mk_cctype_name(KeyType, Defs),
  +    CValueType = mk_cctype_name(ValueType, Defs),
  +    "::google::protobuf::Map< " ++ CKeyType ++ ", " ++ CValueType ++ " >";
  +mk_cctype_name(Type, _Defs) ->
  +    case Type of
  +        sint32   -> "::google::protobuf::int32";
  +        sint64   -> "::google::protobuf::int64";
  +        int32    -> "::google::protobuf::int32";
  +        int64    -> "::google::protobuf::int64";
  +        uint32   -> "::google::protobuf::uint32";
  +        uint64   -> "::google::protobuf::uint64";
  +        bool     -> "bool";
  +        fixed64  -> "::google::protobuf::uint64";
  +        sfixed64 -> "::google::protobuf::int64";
  +        double   -> "double";
  +        string   -> "::std::string";
  +        bytes    -> "::std::string";
  +        fixed32  -> "::google::protobuf::uint32";
  +        sfixed32 -> "::google::protobuf::int32";
  +        float    -> "float"
  +    end.
  +
   format_load_nif(Mod, Opts) ->
       VsnAsList = gpb:version_as_list(),
       case proplists:get_value(load_nif, Opts, '$undefined') of
  
positive.code:      "\n"].
  
  format_nif_cc_field_unpacker(DestVar, MsgVar, _MsgName, #?gpb_field{}=Field,
                               Defs) ->
      #?gpb_field{occurrence=Occurrence}=Field,
      case Occurrence of
          required ->
              format_nif_cc_field_unpacker_single(DestVar, MsgVar, Field, Defs);
          optional ->
              format_nif_cc_field_unpacker_single(DestVar, MsgVar, Field, Defs);
          repeated ->
              format_nif_cc_field_unpacker_repeated(DestVar, MsgVar, Field, Defs)
      end;
  format_nif_cc_field_unpacker(DestVar, MsgVar, MsgName, #gpb_oneof{}=Field,
                               Defs) ->
      #gpb_oneof{name=OFName, fields=OFields} = Field,
      CPkg = get_cc_pkg(Defs),
      CMsgType = CPkg ++ "::" ++ dot_replace_s(MsgName, "::"),
  
negative.code:      "\n",
       [begin
            DestVar = ?f("elem~w",[I]),
            format_nif_cc_field_unpacker(DestVar, "m", MsgName, Field, Defs, Opts)
        end
        || {I, Field} <- index_seq(Fields)],
       "\n",
  