Skip to content

Commit 41e31d3

Browse files
glebmfincs
andauthored
Add CTR_ prefix to ALIGN,PACKED,DEPRECATED macros (#532)
Co-authored-by: fincs <fincs@devkitpro.org>
1 parent 687aaf6 commit 41e31d3

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

libctru/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,7 @@ INCLUDE_FILE_PATTERNS =
20232023
# recursively expanded use the := operator instead of the = operator.
20242024
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
20252025

2026-
PREDEFINED = PACKED
2026+
PREDEFINED = CTR_PACKED
20272027

20282028
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
20292029
# tag can be used to specify a list of macro names that should be expanded. The

libctru/include/3ds/gfx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void gfxScreenSwapBuffers(gfxScreen_t scr, bool hasStereo);
166166
* @param immediate This parameter no longer has any effect and is thus ignored.
167167
* @deprecated This function has been superseded by \ref gfxScreenSwapBuffers, please use that instead.
168168
*/
169-
DEPRECATED void gfxConfigScreen(gfxScreen_t scr, bool immediate);
169+
CTR_DEPRECATED void gfxConfigScreen(gfxScreen_t scr, bool immediate);
170170

171171
/**
172172
* @brief Updates the configuration of both screens.

libctru/include/3ds/ipc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static inline u32 IPC_Desc_CurProcessId(void)
7070
return 0x20;
7171
}
7272

73-
static inline DEPRECATED u32 IPC_Desc_CurProcessHandle(void)
73+
static inline CTR_DEPRECATED u32 IPC_Desc_CurProcessHandle(void)
7474
{
7575
return IPC_Desc_CurProcessId();
7676
}

libctru/include/3ds/mii.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ typedef struct
147147
} glasses_details;
148148

149149
/// Mole details
150-
struct
150+
struct
151151
{
152152
bool enable : 1;
153153
u16 scale : 5;
@@ -156,4 +156,4 @@ typedef struct
156156
} mole_details;
157157

158158
u16 author_name[10]; ///< Name of Mii's author (Encoded using UTF16)
159-
} PACKED MiiData;
159+
} CTR_PACKED MiiData;

libctru/include/3ds/services/apt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ bool aptShouldJumpToHome(void);
176176
bool aptCheckHomePressRejected(void);
177177

178178
/// \deprecated Alias for \ref aptCheckHomePressRejected.
179-
static inline DEPRECATED bool aptIsHomePressed(void)
179+
static inline CTR_DEPRECATED bool aptIsHomePressed(void)
180180
{
181181
return aptCheckHomePressRejected();
182182
}

libctru/include/3ds/services/fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ typedef struct
202202
} FS_IntegrityVerificationSeed;
203203

204204
/// Ext save data information.
205-
typedef struct PACKED
205+
typedef struct CTR_PACKED
206206
{
207207
FS_MediaType mediaType : 8; ///< Media type.
208208
u8 unknown; ///< Unknown.

libctru/include/3ds/types.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ typedef void (*voidfn)(void);
4747
#define BIT(n) (1U<<(n))
4848

4949
/// Aligns a struct (and other types?) to m, making sure that the size of the struct is a multiple of m.
50-
#define ALIGN(m) __attribute__((aligned(m)))
50+
#define CTR_ALIGN(m) __attribute__((aligned(m)))
5151
/// Packs a struct (and other types?) so it won't include padding bytes.
52-
#define PACKED __attribute__((packed))
52+
#define CTR_PACKED __attribute__((packed))
5353

54-
#ifndef LIBCTRU_NO_DEPRECATION
54+
#ifndef CTR_NO_DEPRECATION
5555
/// Flags a function as deprecated.
56-
#define DEPRECATED __attribute__ ((deprecated))
56+
#define CTR_DEPRECATED __attribute__ ((deprecated))
5757
#else
5858
/// Flags a function as deprecated.
59-
#define DEPRECATED
59+
#define CTR_DEPRECATED
6060
#endif
6161

6262
/// Structure representing CPU registers
@@ -71,7 +71,7 @@ typedef struct {
7171
/// Structure representing FPU registers
7272
typedef struct {
7373
union {
74-
struct PACKED { double d[16]; }; ///< d0-d15.
74+
struct CTR_PACKED { double d[16]; }; ///< d0-d15.
7575
float s[32]; ///< s0-s31.
7676
};
7777
u32 fpscr; ///< fpscr.

libctru/source/gdbhio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static int _gdbExportSeekFlag(int flag)
205205
// https://sourceware.org/gdb/onlinedocs/gdb/struct-stat.html#struct-stat
206206
typedef u32 gdbhio_time_t;
207207

208-
struct PACKED ALIGN(4) gdbhio_stat {
208+
struct CTR_PACKED CTR_ALIGN(4) gdbhio_stat {
209209
u32 gst_dev; /* device */
210210
u32 gst_ino; /* inode */
211211
gdbhio_mode_t gst_mode; /* protection */

libctru/source/services/soc/soc_inet_pton.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
static int inet_pton4(const char *restrict src, void *restrict dst)
88
{
9-
u8 ip[4] ALIGN(4);
9+
u8 ip[4] CTR_ALIGN(4);
1010
if(sscanf(src,"%hhu.%hhu.%hhu.%hhu",&ip[0], &ip[1], &ip[2], &ip[3]) != 4) return 0;
1111

1212
memcpy(dst,ip,4);

0 commit comments

Comments
 (0)