anchor.diff:                  ?f("        ERL_NIF_TERM ores;\n"),
                   split_indent_iolist(
                     8,
  -                  format_nif_cc_field_unpacker_by_type("ores", MsgVar,
  -                                                       OField, Defs)),
  +                  format_nif_cc_field_unpacker_by_field("ores", MsgVar,
  +                                                        OField, Defs)),
                   ?f("        ~s = enif_make_tuple2(env, ~s, ores);\n",
                      [DestVar, AtomVar]),
                   ?f("    }\n"),
  
positive.code:                   "    double v;\n"
                    "    if (!enif_get_double(env, ~s, &v))\n"
                    "        return 0;\n"
                    "    ~s->~s((float)v);\n"
                    "}\n",
                    [SrcVar, MsgVar, SetterFnName]);
             double ->
                 ?f("{\n"
                    "    double v;\n"
                    "    if (!enif_get_double(env, ~s, &v))\n"
                    "        return 0;\n"
                    "    ~s->~s(v);\n"
                    "}\n",
                    [SrcVar, MsgVar, SetterFnName]);
             _S32 when FType == sint32;
                       FType == int32;
                       FType == sfixed32 ->
  
negative.code:      "    }\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
  