Skip to content

Commit

Permalink
erts: Do not annotate nif API functions on windows
Browse files Browse the repository at this point in the history
On windows nifs can be compiled with gcc/clang which
means that __has_attribute(malloc) is defined. This
was never intended to work so we disable it on Windows.

closes #9015
  • Loading branch information
garazdawi committed Nov 4, 2024
1 parent 6307ce2 commit 40fa3de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erts/emulator/beam/erl_drv_nif.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ typedef struct {
* D: Has 1-to-1 Deallocator function with ptr argument. ((malloc(DTOR,PTRPOS)))
*/

#ifdef __has_attribute
#ifdef __has_attribute && !defined(__WIN32__)
# if __has_attribute(warn_unused_result)
# undef ERL_NAPI_ATTR_WUR
# define ERL_NAPI_ATTR_WUR __attribute__((warn_unused_result))
Expand Down

0 comments on commit 40fa3de

Please sign in to comment.