mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-23 17:42:22 +00:00
-mx32 is not supported in gcc 4.6.x. change to use if-else sizeof(void*) in test code
This commit is contained in:
parent
c70990703f
commit
dc4bb9d104
@ -42,7 +42,8 @@
|
|||||||
# 1) remove the trailing [] from the :common: section
|
# 1) remove the trailing [] from the :common: section
|
||||||
# 2) add entries to the :common: section (e.g. :test: has TEST defined)
|
# 2) add entries to the :common: section (e.g. :test: has TEST defined)
|
||||||
:commmon: &common_defines
|
:commmon: &common_defines
|
||||||
- MCU=MCU_LPC43XX -std=gnu99 -mx32
|
- MCU=MCU_LPC43XX -std=gnu99
|
||||||
|
# - -mx32
|
||||||
- CORE_M4
|
- CORE_M4
|
||||||
- __CODE_RED
|
- __CODE_RED
|
||||||
- _TINY_USB_SOURCE_FILE_
|
- _TINY_USB_SOURCE_FILE_
|
||||||
|
@ -98,9 +98,13 @@ void test_struct_alignment(void)
|
|||||||
|
|
||||||
void test_struct_size(void)
|
void test_struct_size(void)
|
||||||
{
|
{
|
||||||
TEST_ASSERT_EQUAL( 4, sizeof(void*));
|
if (4 < sizeof(void*)) // running tests in x64 environment
|
||||||
TEST_ASSERT_EQUAL( 4, sizeof(ehci_qtd_t*));
|
{
|
||||||
TEST_ASSERT_EQUAL( 64, sizeof(ehci_qhd_t) );
|
TEST_ASSERT_EQUAL( 64 - 2*sizeof(void*), offsetof(ehci_qhd_t, p_qtd_list_head) );
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
TEST_ASSERT_EQUAL( 64, sizeof(ehci_qhd_t) );
|
||||||
|
}
|
||||||
TEST_ASSERT_EQUAL( 32, sizeof(ehci_qtd_t) );
|
TEST_ASSERT_EQUAL( 32, sizeof(ehci_qtd_t) );
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL( 64, sizeof(ehci_itd_t) );
|
TEST_ASSERT_EQUAL( 64, sizeof(ehci_itd_t) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user