diff --git a/src/bindgen/items.rs b/src/bindgen/items.rs
index 6eff0cb9732bf460b47d0401535d3e9af13765a1..b533619fd5cb6f9239fb41c181caf5cb1cec3ee3 100644
--- a/src/bindgen/items.rs
+++ b/src/bindgen/items.rs
@@ -802,7 +802,7 @@ impl Specialization {
         }
     }
 
-    pub fn specialize(&self, library: &Library) -> ConvertResult<PathValue> {
+    pub fn specialize(&self, config: &Config, library: &Library) -> ConvertResult<PathValue> {
         match library.resolve_path(&self.aliased) {
             Some(aliased) => {
                 match aliased {
@@ -821,22 +821,29 @@ impl Specialization {
                         let mappings = aliased.generic_params.iter()
                                                              .zip(self.generic_values.iter())
                                                              .collect::<Vec<_>>();
-                        Ok(PathValue::Struct(Struct {
+
+                        let mut value = Struct {
                             name: self.name.clone(),
                             directives: self.directives.clone(),
                             fields: aliased.fields.iter()
                                                   .map(|x| (x.0.clone(), x.1.specialize(&mappings)))
                                                   .collect(),
                             generic_params: vec![],
-                        }))
+                        };
+                        value.resolve(config);
+
+                        Ok(PathValue::Struct(value))
                     }
                     PathValue::Enum(aliased) => {
-                        Ok(PathValue::Enum(Enum {
+                        let mut value = Enum {
                             name: self.name.clone(),
                             repr: aliased.repr.clone(),
                             directives: self.directives.clone(),
                             values: aliased.values.clone(),
-                        }))
+                        };
+                        value.resolve(config);
+
+                        Ok(PathValue::Enum(value))
                     }
                     PathValue::Typedef(aliased) => {
                         Ok(PathValue::Typedef(Typedef {
@@ -851,7 +858,7 @@ impl Specialization {
                             directives: self.directives.clone(),
                             aliased: aliased.aliased.clone(),
                             generic_values: aliased.generic_values.clone(),
-                        }.specialize(library)
+                        }.specialize(config, library)
                     }
                 }
             }
diff --git a/src/bindgen/library.rs b/src/bindgen/library.rs
index 02e2571eea6e81d500c16f3e9ab9ee38dd0aae9e..7c5286d7669bd57de0bd7e8f6cbcef7ff6bbf3c3 100644
--- a/src/bindgen/library.rs
+++ b/src/bindgen/library.rs
@@ -325,7 +325,7 @@ impl<'a> Library<'a> {
                     }
                 }
                 &PathValue::Specialization(ref s) => {
-                    match s.specialize(&self) {
+                    match s.specialize(self.config, &self) {
                         Ok(value) => {
                             result.items.push(value);
                         }