Skip to content

Commit 19f908d

Browse files
committed
unix port guard macro fix
1 parent 08a0871 commit 19f908d

File tree

2 files changed

+36
-39
lines changed

2 files changed

+36
-39
lines changed

ext_mod/lcd_bus/unix/include/sdl_bus.h

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,52 @@
1010

1111
#define SDL_MAIN_HANDLED /*To fix SDL's "undefined reference to WinMain" issue*/
1212

13-
#ifdef MP_PORT_UNIX
14-
#include "SDL.h"
15-
#include "SDL_thread.h"
13+
#include "SDL.h"
14+
#include "SDL_thread.h"
1615

17-
typedef struct {
18-
int32_t x;
19-
int32_t y;
20-
uint8_t state;
21-
} pointer_event_t;
16+
typedef struct {
17+
int32_t x;
18+
int32_t y;
19+
uint8_t state;
20+
} pointer_event_t;
2221

23-
typedef struct _panel_io_config_t {
24-
uint16_t width;
25-
uint16_t height;
26-
uint32_t win_id;
27-
void *buf_to_flush;
28-
uint8_t bytes_per_pixel;
29-
int flags;
30-
} panel_io_config_t;
22+
typedef struct _panel_io_config_t {
23+
uint16_t width;
24+
uint16_t height;
25+
uint32_t win_id;
26+
void *buf_to_flush;
27+
uint8_t bytes_per_pixel;
28+
int flags;
29+
} panel_io_config_t;
3130

32-
typedef struct _mp_lcd_sdl_bus_obj_t {
33-
mp_obj_base_t base;
31+
typedef struct _mp_lcd_sdl_bus_obj_t {
32+
mp_obj_base_t base;
3433

35-
mp_obj_t callback;
34+
mp_obj_t callback;
3635

37-
void *buf1;
38-
void *buf2;
36+
void *buf1;
37+
void *buf2;
3938

40-
bool trans_done;
41-
bool rgb565_byte_swap;
39+
bool trans_done;
40+
bool rgb565_byte_swap;
4241

43-
lcd_panel_io_t panel_io_handle;
42+
lcd_panel_io_t panel_io_handle;
4443

45-
panel_io_config_t panel_io_config;
46-
SDL_Window *window;
47-
SDL_Renderer *renderer;
48-
SDL_Texture *texture;
44+
panel_io_config_t panel_io_config;
45+
SDL_Window *window;
46+
SDL_Renderer *renderer;
47+
SDL_Texture *texture;
4948

50-
pointer_event_t pointer_event;
51-
mp_obj_t keypad_callback;
52-
mp_obj_t window_callback;
53-
mp_obj_t mouse_callback;
54-
mp_obj_t quit_callback;
49+
pointer_event_t pointer_event;
50+
mp_obj_t keypad_callback;
51+
mp_obj_t window_callback;
52+
mp_obj_t mouse_callback;
53+
mp_obj_t quit_callback;
5554

56-
bool ignore_size_chg;
57-
bool inited;
55+
bool ignore_size_chg;
56+
bool inited;
5857

59-
} mp_lcd_sdl_bus_obj_t;
58+
} mp_lcd_sdl_bus_obj_t;
6059

61-
extern const mp_obj_type_t mp_lcd_sdl_bus_type;
62-
#endif
60+
extern const mp_obj_type_t mp_lcd_sdl_bus_type;
6361
#endif

ext_mod/lcd_bus/unix/src/sdl_bus.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
// mp_printf(&mp_plat_print, "incomming event %d\n", event->type);
1414

15-
#ifdef MP_PORT_UNIX
1615
#include "SDL.h"
1716
#include "SDL_thread.h"
1817

0 commit comments

Comments
 (0)