Changeset 3a5c71d in rtems


Ignore:
Timestamp:
Jan 10, 2019, 7:10:17 AM (2 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
7bde91b
Parents:
e7d623e7
git-author:
Sebastian Huber <sebastian.huber@…> (01/10/19 07:10:17)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/10/19 07:12:16)
Message:

psxconfig01: Fix pre-processor conditions

Do not rely on compiler optimizations to throw away empty loops.

Close #3673.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psxconfig01/init.c

    re7d623e7 r3a5c71d  
    4949
    5050#define CONFIGURE_MAXIMUM_POSIX_KEYS 23
    51 #ifdef CONFIGURE_MAXIMUM_POSIX_KEYS
     51#if CONFIGURE_MAXIMUM_POSIX_KEYS > 0
    5252  #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS CONFIGURE_MAXIMUM_POSIX_KEYS
    5353#endif
     
    8181#endif
    8282
    83 #ifdef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
     83#if CONFIGURE_MAXIMUM_MESSAGE_QUEUES > 0
    8484  #define MQ_0_COUNT 2
    8585  #define MQ_1_COUNT 3
     
    130130#endif
    131131
    132 #ifdef POSIX_MQ_COUNT
     132#if POSIX_MQ_COUNT > 0
    133133  #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES POSIX_MQ_COUNT
    134134
     
    191191} area;
    192192
    193 #ifdef CONFIGURE_MAXIMUM_PARTITIONS
     193#if CONFIGURE_MAXIMUM_PARTITIONS > 0
    194194  static area partition_areas [CONFIGURE_MAXIMUM_PARTITIONS];
    195195#endif
    196196
    197 #ifdef CONFIGURE_MAXIMUM_REGIONS
     197#if CONFIGURE_MAXIMUM_REGIONS > 0
    198198  static area region_areas [CONFIGURE_MAXIMUM_REGIONS];
    199199#endif
     
    264264  rtems_test_assert(rtems_resource_snapshot_check(&snapshot));
    265265
    266 #ifdef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
     266#if CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS > 0
    267267  for (i = 3; i < CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; ++i) {
    268268    int oflag = O_WRONLY | O_CREAT | O_TRUNC;
     
    278278#endif
    279279
    280 #ifdef CONFIGURE_MAXIMUM_USER_EXTENSIONS
     280#if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
    281281  memset(&table, 0, sizeof(table));
    282282  for (i = 0; i < CONFIGURE_MAXIMUM_USER_EXTENSIONS; ++i) {
     
    290290#endif
    291291
    292 #ifdef CONFIGURE_MAXIMUM_POSIX_KEYS
     292#if CONFIGURE_MAXIMUM_POSIX_KEYS > 0
    293293  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_KEYS; ++i) {
    294294    eno = pthread_key_create(&key, posix_key_dtor);
     
    311311#endif
    312312
    313 #ifdef CONFIGURE_MAXIMUM_BARRIERS
     313#if CONFIGURE_MAXIMUM_BARRIERS > 0
    314314  for (i = 0; i < CONFIGURE_MAXIMUM_BARRIERS; ++i) {
    315315    sc = rtems_barrier_create(name, RTEMS_DEFAULT_ATTRIBUTES, 1, &id);
     
    322322#endif
    323323
    324 #ifdef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
     324#if CONFIGURE_MAXIMUM_MESSAGE_QUEUES > 0
    325325  for (i = 0; i < CONFIGURE_MAXIMUM_MESSAGE_QUEUES; ++i) {
    326326    sc = rtems_message_queue_create(
     
    340340#endif
    341341
    342 #ifdef CONFIGURE_MAXIMUM_PARTITIONS
     342#if CONFIGURE_MAXIMUM_PARTITIONS > 0
    343343  for (i = 0; i < CONFIGURE_MAXIMUM_PARTITIONS; ++i) {
    344344    sc = rtems_partition_create(
     
    358358#endif
    359359
    360 #ifdef CONFIGURE_MAXIMUM_PERIODS
     360#if CONFIGURE_MAXIMUM_PERIODS > 0
    361361  for (i = 0; i < CONFIGURE_MAXIMUM_PERIODS; ++i) {
    362362    sc = rtems_rate_monotonic_create(name, &id);
     
    369369#endif
    370370
    371 #ifdef CONFIGURE_MAXIMUM_REGIONS
     371#if CONFIGURE_MAXIMUM_REGIONS > 0
    372372  for (i = 0; i < CONFIGURE_MAXIMUM_REGIONS; ++i) {
    373373    sc = rtems_region_create(
     
    387387#endif
    388388
    389 #ifdef CONFIGURE_MAXIMUM_SEMAPHORES
     389#if CONFIGURE_MAXIMUM_SEMAPHORES > 0
    390390  for (i = 0; i < CONFIGURE_MAXIMUM_SEMAPHORES; ++i) {
    391391    sc = rtems_semaphore_create(
     
    404404#endif
    405405
    406 #ifdef CONFIGURE_MAXIMUM_TASKS
     406#if CONFIGURE_MAXIMUM_TASKS > 0
    407407  for (i = 1; i < CONFIGURE_MAXIMUM_TASKS; ++i) {
    408408    sc = rtems_task_create(
     
    422422#endif
    423423
    424 #ifdef CONFIGURE_MAXIMUM_TIMERS
     424#if CONFIGURE_MAXIMUM_TIMERS > 0
    425425  for (i = 0; i < CONFIGURE_MAXIMUM_TIMERS; ++i) {
    426426    sc = rtems_timer_create(name, &id);
     
    433433#endif
    434434
    435 #ifdef POSIX_MQ_COUNT
     435#if POSIX_MQ_COUNT > 0
    436436  for (i = 0; i < POSIX_MQ_COUNT; ++i) {
    437437    int oflag = O_RDWR | O_CREAT | O_EXCL;
     
    452452#endif
    453453
    454 #ifdef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
     454#if CONFIGURE_MAXIMUM_POSIX_SEMAPHORES > 0
    455455  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; ++i) {
    456456    int oflag = O_RDWR | O_CREAT | O_EXCL;
     
    467467#endif
    468468
    469 #ifdef CONFIGURE_MAXIMUM_POSIX_THREADS
     469#if CONFIGURE_MAXIMUM_POSIX_THREADS > 0
    470470  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_THREADS; ++i) {
    471471    pthread_t thread;
     
    492492#endif
    493493
    494 #ifdef CONFIGURE_MAXIMUM_POSIX_TIMERS
     494#if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
    495495  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_TIMERS; ++i) {
    496496    timer_t timer_id;
Note: See TracChangeset for help on using the changeset viewer.