Skip to content

Remove the ENABLED/DISABLED macros #4515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions jerry-core/api/jerry-debugger-transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "jcontext.h"
#include "jerryscript.h"

#if ENABLED (JERRY_DEBUGGER)
#if JERRY_DEBUGGER

/**
* Minimum number of bytes transmitted or received.
Expand Down Expand Up @@ -247,4 +247,4 @@ jerry_debugger_transport_sleep (void)
jerry_port_sleep (JERRY_DEBUGGER_TRANSPORT_TIMEOUT);
} /* jerry_debugger_transport_sleep */

#endif /* ENABLED (JERRY_DEBUGGER) */
#endif /* JERRY_DEBUGGER */
38 changes: 19 additions & 19 deletions jerry-core/api/jerry-debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
bool
jerry_debugger_is_connected (void)
{
#if ENABLED (JERRY_DEBUGGER)
#if JERRY_DEBUGGER
return JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED;
#else /* !ENABLED (JERRY_DEBUGGER) */
#else /* !JERRY_DEBUGGER */
return false;
#endif /* ENABLED (JERRY_DEBUGGER) */
#endif /* JERRY_DEBUGGER */
} /* jerry_debugger_is_connected */

/**
Expand All @@ -39,14 +39,14 @@ jerry_debugger_is_connected (void)
void
jerry_debugger_stop (void)
{
#if ENABLED (JERRY_DEBUGGER)
#if JERRY_DEBUGGER
if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
&& !(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_BREAKPOINT_MODE))
{
JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_VM_STOP);
JERRY_CONTEXT (debugger_stop_context) = NULL;
}
#endif /* ENABLED (JERRY_DEBUGGER) */
#endif /* JERRY_DEBUGGER */
} /* jerry_debugger_stop */

/**
Expand All @@ -55,14 +55,14 @@ jerry_debugger_stop (void)
void
jerry_debugger_continue (void)
{
#if ENABLED (JERRY_DEBUGGER)
#if JERRY_DEBUGGER
if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
&& !(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_BREAKPOINT_MODE))
{
JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_VM_STOP);
JERRY_CONTEXT (debugger_stop_context) = NULL;
}
#endif /* ENABLED (JERRY_DEBUGGER) */
#endif /* JERRY_DEBUGGER */
} /* jerry_debugger_continue */

/**
Expand All @@ -71,7 +71,7 @@ jerry_debugger_continue (void)
void
jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint) /**< enable/disable stop at breakpoint */
{
#if ENABLED (JERRY_DEBUGGER)
#if JERRY_DEBUGGER
if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED
&& !(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_BREAKPOINT_MODE))
{
Expand All @@ -84,9 +84,9 @@ jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint) /**< enable/d
JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_VM_IGNORE);
}
}
#else /* !ENABLED (JERRY_DEBUGGER) */
#else /* !JERRY_DEBUGGER */
JERRY_UNUSED (enable_stop_at_breakpoint);
#endif /* ENABLED (JERRY_DEBUGGER) */
#endif /* JERRY_DEBUGGER */
} /* jerry_debugger_stop_at_breakpoint */

/**
Expand All @@ -104,7 +104,7 @@ jerry_debugger_wait_for_client_source (jerry_debugger_wait_for_source_callback_t
{
*return_value = jerry_create_undefined ();

#if ENABLED (JERRY_DEBUGGER)
#if JERRY_DEBUGGER
if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
&& !(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_BREAKPOINT_MODE))
{
Expand Down Expand Up @@ -176,12 +176,12 @@ jerry_debugger_wait_for_client_source (jerry_debugger_wait_for_source_callback_t
}

return JERRY_DEBUGGER_SOURCE_RECEIVE_FAILED;
#else /* !ENABLED (JERRY_DEBUGGER) */
#else /* !JERRY_DEBUGGER */
JERRY_UNUSED (callback_p);
JERRY_UNUSED (user_p);

return JERRY_DEBUGGER_SOURCE_RECEIVE_FAILED;
#endif /* ENABLED (JERRY_DEBUGGER) */
#endif /* JERRY_DEBUGGER */
} /* jerry_debugger_wait_for_client_source */

/**
Expand All @@ -192,18 +192,18 @@ void
jerry_debugger_send_output (const jerry_char_t *buffer, /**< buffer */
jerry_size_t str_size) /**< string size */
{
#if ENABLED (JERRY_DEBUGGER)
#if JERRY_DEBUGGER
if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
{
jerry_debugger_send_string (JERRY_DEBUGGER_OUTPUT_RESULT,
JERRY_DEBUGGER_OUTPUT_OK,
(const uint8_t *) buffer,
sizeof (uint8_t) * str_size);
}
#else /* !ENABLED (JERRY_DEBUGGER) */
#else /* !JERRY_DEBUGGER */
JERRY_UNUSED (buffer);
JERRY_UNUSED (str_size);
#endif /* ENABLED (JERRY_DEBUGGER) */
#endif /* JERRY_DEBUGGER */
} /* jerry_debugger_send_output */

/**
Expand All @@ -214,17 +214,17 @@ jerry_debugger_send_log (jerry_log_level_t level, /**< level of the diagnostics
const jerry_char_t *buffer, /**< buffer */
jerry_size_t str_size) /**< string size */
{
#if ENABLED (JERRY_DEBUGGER)
#if JERRY_DEBUGGER
if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
{
jerry_debugger_send_string (JERRY_DEBUGGER_OUTPUT_RESULT,
(uint8_t) (level + 2),
(const uint8_t *) buffer,
sizeof (uint8_t) * str_size);
}
#else /* !ENABLED (JERRY_DEBUGGER) */
#else /* !JERRY_DEBUGGER */
JERRY_UNUSED (level);
JERRY_UNUSED (buffer);
JERRY_UNUSED (str_size);
#endif /* ENABLED (JERRY_DEBUGGER) */
#endif /* JERRY_DEBUGGER */
} /* jerry_debugger_send_log */
Loading