Browse Source

🔨 Prevent build attribute define conflicts

Scott Lahteine 3 years ago
parent
commit
659b4172aa

+ 5
- 5
Marlin/src/core/macros.h View File

82
 #define  FORCE_INLINE  __attribute__((always_inline)) inline
82
 #define  FORCE_INLINE  __attribute__((always_inline)) inline
83
 #define NO_INLINE      __attribute__((noinline))
83
 #define NO_INLINE      __attribute__((noinline))
84
 #define _UNUSED      __attribute__((unused))
84
 #define _UNUSED      __attribute__((unused))
85
-#define _O0          __attribute__((optimize("O0")))
86
-#define _Os          __attribute__((optimize("Os")))
87
-#define _O1          __attribute__((optimize("O1")))
88
-#define _O2          __attribute__((optimize("O2")))
89
-#define _O3          __attribute__((optimize("O3")))
85
+#define __O0         __attribute__((optimize("O0")))
86
+#define __Os         __attribute__((optimize("Os")))
87
+#define __O1         __attribute__((optimize("O1")))
88
+#define __O2         __attribute__((optimize("O2")))
89
+#define __O3         __attribute__((optimize("O3")))
90
 
90
 
91
 #define IS_CONSTEXPR(...) __builtin_constant_p(__VA_ARGS__) // Only valid solution with C++14. Should use std::is_constant_evaluated() in C++20 instead
91
 #define IS_CONSTEXPR(...) __builtin_constant_p(__VA_ARGS__) // Only valid solution with C++14. Should use std::is_constant_evaluated() in C++20 instead
92
 
92
 

+ 9
- 9
Marlin/src/feature/bedlevel/ubl/ubl.h View File

70
     static void move_z_with_encoder(const_float_t multiplier);
70
     static void move_z_with_encoder(const_float_t multiplier);
71
     static float measure_point_with_encoder();
71
     static float measure_point_with_encoder();
72
     static float measure_business_card_thickness();
72
     static float measure_business_card_thickness();
73
-    static void manually_probe_remaining_mesh(const xy_pos_t&, const_float_t , const_float_t , const bool) _O0;
74
-    static void fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) _O0;
73
+    static void manually_probe_remaining_mesh(const xy_pos_t&, const_float_t , const_float_t , const bool) __O0;
74
+    static void fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) __O0;
75
   #endif
75
   #endif
76
 
76
 
77
-  static bool G29_parse_parameters() _O0;
77
+  static bool G29_parse_parameters() __O0;
78
   static void shift_mesh_height();
78
   static void shift_mesh_height();
79
-  static void probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) _O0;
79
+  static void probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) __O0;
80
   static void tilt_mesh_based_on_3pts(const_float_t z1, const_float_t z2, const_float_t z3);
80
   static void tilt_mesh_based_on_3pts(const_float_t z1, const_float_t z2, const_float_t z3);
81
   static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map);
81
   static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map);
82
   static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir);
82
   static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir);
98
   static void report_state();
98
   static void report_state();
99
   static void save_ubl_active_state_and_disable();
99
   static void save_ubl_active_state_and_disable();
100
   static void restore_ubl_active_state_and_leave();
100
   static void restore_ubl_active_state_and_leave();
101
-  static void display_map(const uint8_t) _O0;
102
-  static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) _O0;
103
-  static mesh_index_pair find_furthest_invalid_mesh_point() _O0;
101
+  static void display_map(const uint8_t) __O0;
102
+  static mesh_index_pair find_closest_mesh_point_of_type(const MeshPointType, const xy_pos_t&, const bool=false, MeshFlags *done_flags=nullptr) __O0;
103
+  static mesh_index_pair find_furthest_invalid_mesh_point() __O0;
104
   static void reset();
104
   static void reset();
105
   static void invalidate();
105
   static void invalidate();
106
   static void set_all_mesh_points_to_value(const_float_t value);
106
   static void set_all_mesh_points_to_value(const_float_t value);
107
   static void adjust_mesh_to_mean(const bool cflag, const_float_t value);
107
   static void adjust_mesh_to_mean(const bool cflag, const_float_t value);
108
   static bool sanity_check();
108
   static bool sanity_check();
109
 
109
 
110
-  static void G29() _O0;                          // O0 for no optimization
111
-  static void smart_fill_wlsf(const_float_t ) _O2; // O2 gives smaller code than Os on A2560
110
+  static void G29() __O0;                           // O0 for no optimization
111
+  static void smart_fill_wlsf(const_float_t ) __O2; // O2 gives smaller code than Os on A2560
112
 
112
 
113
   static int8_t storage_slot;
113
   static int8_t storage_slot;
114
 
114
 

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp View File

340
    * Returns true if did NOT move, false if moved (requires current_position update).
340
    * Returns true if did NOT move, false if moved (requires current_position update).
341
    */
341
    */
342
 
342
 
343
-  bool _O2 unified_bed_leveling::line_to_destination_segmented(const_feedRate_t scaled_fr_mm_s) {
343
+  bool __O2 unified_bed_leveling::line_to_destination_segmented(const_feedRate_t scaled_fr_mm_s) {
344
 
344
 
345
     if (!position_is_reachable(destination))  // fail if moving outside reachable boundary
345
     if (!position_is_reachable(destination))  // fail if moving outside reachable boundary
346
       return true;                            // did not move, so current_position still accurate
346
       return true;                            // did not move, so current_position still accurate

+ 3
- 3
Marlin/src/libs/bresenham.h View File

30
  */
30
  */
31
 
31
 
32
 #define FORCE_INLINE  __attribute__((always_inline)) inline
32
 #define FORCE_INLINE  __attribute__((always_inline)) inline
33
-#define _O3           __attribute__((optimize("O3")))
33
+#define __O3          __attribute__((optimize("O3")))
34
 
34
 
35
 template <uint8_t uid, uint8_t size>
35
 template <uint8_t uid, uint8_t size>
36
 struct BresenhamCfg { static constexpr uint8_t UID = uid, SIZE = size; };
36
 struct BresenhamCfg { static constexpr uint8_t UID = uid, SIZE = size; };
114
     if (tick1(index)) { value[index] += dir[index]; back(index); }
114
     if (tick1(index)) { value[index] += dir[index]; back(index); }
115
   }
115
   }
116
 
116
 
117
-  FORCE_INLINE static void tick1() _O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick1(i); }
117
+  FORCE_INLINE static void tick1() __O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick1(i); }
118
 
118
 
119
-  FORCE_INLINE static void tick() _O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick(i); }
119
+  FORCE_INLINE static void tick() __O3 { for (uint8_t i = 0; i < Cfg::SIZE; i++) (void)tick(i); }
120
 
120
 
121
   static void report(const uint8_t index) {
121
   static void report(const uint8_t index) {
122
     if (index < Cfg::SIZE) {
122
     if (index < Cfg::SIZE) {

+ 6
- 6
Marlin/src/libs/nozzle.h View File

41
      * @param end xyz_pos_t defining the ending point
41
      * @param end xyz_pos_t defining the ending point
42
      * @param strokes number of strokes to execute
42
      * @param strokes number of strokes to execute
43
      */
43
      */
44
-    static void stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) _Os;
44
+    static void stroke(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes) __Os;
45
 
45
 
46
     /**
46
     /**
47
      * @brief Zig-zag clean pattern
47
      * @brief Zig-zag clean pattern
52
      * @param strokes number of strokes to execute
52
      * @param strokes number of strokes to execute
53
      * @param objects number of objects to create
53
      * @param objects number of objects to create
54
      */
54
      */
55
-    static void zigzag(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes, const uint8_t &objects) _Os;
55
+    static void zigzag(const xyz_pos_t &start, const xyz_pos_t &end, const uint8_t &strokes, const uint8_t &objects) __Os;
56
 
56
 
57
     /**
57
     /**
58
      * @brief Circular clean pattern
58
      * @brief Circular clean pattern
62
      * @param strokes number of strokes to execute
62
      * @param strokes number of strokes to execute
63
      * @param radius radius of circle
63
      * @param radius radius of circle
64
      */
64
      */
65
-    static void circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const_float_t radius) _Os;
65
+    static void circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const_float_t radius) __Os;
66
 
66
 
67
   #endif // NOZZLE_CLEAN_FEATURE
67
   #endif // NOZZLE_CLEAN_FEATURE
68
 
68
 
77
      * @param pattern one of the available patterns
77
      * @param pattern one of the available patterns
78
      * @param argument depends on the cleaning pattern
78
      * @param argument depends on the cleaning pattern
79
      */
79
      */
80
-    static void clean(const uint8_t &pattern, const uint8_t &strokes, const_float_t radius, const uint8_t &objects, const uint8_t cleans) _Os;
80
+    static void clean(const uint8_t &pattern, const uint8_t &strokes, const_float_t radius, const uint8_t &objects, const uint8_t cleans) __Os;
81
 
81
 
82
   #endif // NOZZLE_CLEAN_FEATURE
82
   #endif // NOZZLE_CLEAN_FEATURE
83
 
83
 
84
   #if ENABLED(NOZZLE_PARK_FEATURE)
84
   #if ENABLED(NOZZLE_PARK_FEATURE)
85
 
85
 
86
-    static float park_mode_0_height(const_float_t park_z) _Os;
87
-    static void park(const uint8_t z_action, const xyz_pos_t &park=NOZZLE_PARK_POINT) _Os;
86
+    static float park_mode_0_height(const_float_t park_z) __Os;
87
+    static void park(const uint8_t z_action, const xyz_pos_t &park=NOZZLE_PARK_POINT) __Os;
88
 
88
 
89
   #endif
89
   #endif
90
 };
90
 };

+ 1
- 1
Marlin/src/module/endstops.cpp View File

560
 
560
 
561
 #pragma GCC diagnostic pop
561
 #pragma GCC diagnostic pop
562
 
562
 
563
-void _O2 Endstops::report_states() {
563
+void __O2 Endstops::report_states() {
564
   TERN_(BLTOUCH, bltouch._set_SW_mode());
564
   TERN_(BLTOUCH, bltouch._set_SW_mode());
565
   SERIAL_ECHOLNPGM(STR_M119_REPORT);
565
   SERIAL_ECHOLNPGM(STR_M119_REPORT);
566
   #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, F(STR_##S))
566
   #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, F(STR_##S))

+ 1
- 1
Marlin/src/module/temperature.h View File

716
     /**
716
     /**
717
      * Call periodically to manage heaters
717
      * Call periodically to manage heaters
718
      */
718
      */
719
-    static void manage_heater() _O2; // Added _O2 to work around a compiler error
719
+    static void manage_heater() __O2; // __O2 added to work around a compiler error
720
 
720
 
721
     /**
721
     /**
722
      * Preheating hotends
722
      * Preheating hotends

Loading…
Cancel
Save