Skip to content

Commit

Permalink
MacOSX: Fix wrong sem_destroy definition
Browse files Browse the repository at this point in the history
The following build errors can be seen for MacOSX builds:
.../osunixxf.c:882:9: error: 'sem_close' is deprecated [-Werror,-Wdeprecated-declarations]
.../acmacosx.h:122:29: note: expanded from macro 'sem_destroy'
#define sem_destroy         sem_close

sem_destroy() issue is caused by the wrong order of the following lines:
  #define #sem_destroy        sem_close
  #include <semaphore.h>
This patch fixes it by removing the buggy re-definitiion. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
  • Loading branch information
Lv Zheng committed Sep 20, 2016
1 parent 01eb9a5 commit bbcb58f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion source/include/platform/acmacosx.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
#include "aclinux.h"

#ifdef __APPLE__
#define sem_destroy sem_close
#define ACPI_USE_ALTERNATE_TIMEOUT
#endif /* __APPLE__ */

Expand Down
7 changes: 7 additions & 0 deletions source/os_specific/service_layers/osunixxf.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,17 @@ AcpiOsDeleteSemaphore (
return (AE_BAD_PARAMETER);
}

#ifdef __APPLE__
if (sem_close (Sem) == -1)
{
return (AE_BAD_PARAMETER);
}
#else
if (sem_destroy (Sem) == -1)
{
return (AE_BAD_PARAMETER);
}
#endif

return (AE_OK);
}
Expand Down

0 comments on commit bbcb58f

Please sign in to comment.