@@ -370,6 +370,7 @@ namespace df
370370 return ((uint8_t *)ptr) + idx * item->byte_size ();
371371 }
372372 };
373+ #endif
373374
374375 template <class T >
375376 class stl_container_identity : public container_identity {
@@ -406,6 +407,7 @@ namespace df
406407 }
407408 };
408409
410+ #ifdef BUILD_DFHACK_LIB
409411 template <class T >
410412 class ro_stl_container_identity : public container_identity {
411413 protected:
@@ -667,6 +669,18 @@ namespace df
667669 static stl_ptr_vector_identity *get ();
668670 };
669671
672+ // explicit specializations for these two types
673+ // for availability in plugins
674+
675+ template <> struct identity_traits <std::vector<int32_t > > {
676+ static container_identity* get ();
677+ };
678+
679+ template <> struct identity_traits <std::vector<int16_t > > {
680+ static container_identity* get ();
681+ };
682+
683+
670684#ifdef BUILD_DFHACK_LIB
671685 template <class T > struct identity_traits <std::deque<T> > {
672686 static container_identity *get ();
@@ -739,6 +753,19 @@ namespace df
739753 return &identity;
740754 }
741755
756+ // explicit specializations for these two types
757+ // for availability in plugins
758+
759+ extern DFHACK_EXPORT stl_container_identity<std::vector<int32_t > > stl_vector_int32_t_identity;
760+ inline container_identity* identity_traits<std::vector<int32_t > >::get() {
761+ return &stl_vector_int32_t_identity;
762+ }
763+
764+ extern DFHACK_EXPORT stl_container_identity<std::vector<int16_t > > stl_vector_int16_t_identity;
765+ inline container_identity* identity_traits<std::vector<int16_t > >::get() {
766+ return &stl_vector_int16_t_identity;
767+ }
768+
742769#ifdef BUILD_DFHACK_LIB
743770 template <class T >
744771 inline container_identity *identity_traits<std::deque<T> >::get() {
0 commit comments