Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Thu, 2 Aug 2018 07:52:22 +0000 (17:52 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 2 Aug 2018 07:52:22 +0000 (17:52 +1000)
intern/cycles/util/util_defines.h
source/blender/makesrna/RNA_enum_types.h
source/blender/makesrna/intern/rna_sculpt_paint.c

index 1a09f659eb1847d820a2184065bef9cf4ea0930c..8bce4aca69991bd1769a33d49f52f6992c20077e 100644 (file)
 #endif
 
 #if defined(__GNUC__) || defined(__clang__)
+#  if defined(__cplusplus)
 /* Some magic to be sure we don't have reference in the type. */
 template<typename T> static inline T decltype_helper(T x) { return x; }
-#  define TYPEOF(x) decltype(decltype_helper(x))
+#    define TYPEOF(x) decltype(decltype_helper(x))
+#  else
+#    define TYPEOF(x) typeof(x)
+#  endif
 #endif
 
 /* Causes warning:
index 4c0861757f4ceab143bac658edd53aac547fbed2..9efa8475f8e90c642d3e3e4623cb84068f0f7333 100644 (file)
@@ -120,6 +120,8 @@ extern const EnumPropertyItem rna_enum_brush_sculpt_tool_items[];
 extern const EnumPropertyItem rna_enum_brush_vertex_tool_items[];
 extern const EnumPropertyItem rna_enum_brush_image_tool_items[];
 
+extern const EnumPropertyItem rna_enum_particle_edit_hair_brush_items[];
+extern const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[];
 extern const EnumPropertyItem rna_enum_gpencil_sculpt_brush_items[];
 
 extern const EnumPropertyItem rna_enum_uv_sculpt_tool_items[];
index 1f8f95cf38089180949d5dc079fa8502b02d9204..c500c5f261fcf86a6fb96e10a2dabe819567a5a2 100644 (file)
@@ -51,7 +51,7 @@
 
 #include "bmesh.h"
 
-static const EnumPropertyItem particle_edit_hair_brush_items[] = {
+const EnumPropertyItem rna_enum_particle_edit_hair_brush_items[] = {
        {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush"},
        {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
        {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
@@ -124,7 +124,7 @@ static void rna_GPencil_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UN
        WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);
 }
 
-static const EnumPropertyItem particle_edit_disconnected_hair_brush_items[] = {
+const EnumPropertyItem rna_enum_particle_edit_disconnected_hair_brush_items[] = {
        {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush"},
        {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs"},
        {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs"},
@@ -201,8 +201,9 @@ static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
 
        pset->brushtype = value;
 }
-static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UNUSED(ptr),
-                                                     PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
+static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(
+        bContext *C, PointerRNA *UNUSED(ptr),
+        PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
 {
        ViewLayer *view_layer = CTX_data_view_layer(C);
        Object *ob = OBACT(view_layer);
@@ -219,10 +220,10 @@ static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerR
 
        if (psys) {
                if (psys->flag & PSYS_GLOBAL_HAIR) {
-                       return particle_edit_disconnected_hair_brush_items;
+                       return rna_enum_particle_edit_disconnected_hair_brush_items;
                }
                else {
-                       return particle_edit_hair_brush_items;
+                       return rna_enum_particle_edit_hair_brush_items;
                }
        }
 
@@ -935,7 +936,7 @@ static void rna_def_particle_edit(BlenderRNA *brna)
 
        prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "brushtype");
-       RNA_def_property_enum_items(prop, particle_edit_hair_brush_items);
+       RNA_def_property_enum_items(prop, rna_enum_particle_edit_hair_brush_items);
        RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf");
        RNA_def_property_ui_text(prop, "Tool", "");