Skip to content

Commit 72231cf

Browse files
committed
Add condition to team notification of github actions that it's from 'main'
PiperOrigin-RevId: 893437916 Change-Id: I0c0b22747e4e4cac23ad0f44cf8b667863cc79ae
1 parent b3b0bd6 commit 72231cf

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ jobs:
347347
CHATMSG_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
348348
CHATMSG_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
349349
CHATMSG_JOB_ID: ${{ matrix.label }}
350-
if: failure() && github.event_name == 'push' && env.GCHAT_API_URL != '' && github.ref_name == 'main'
350+
if: failure() && github.ref_name == 'main' && github.event_name == 'push' && env.GCHAT_API_URL != ''
351351
run: bash ./.github/workflows/build_steps.sh notify_team_chat
352352

353353
# This job quickly determines if MuJoCo Studio is broken.
@@ -406,7 +406,7 @@ jobs:
406406
CHATMSG_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
407407
CHATMSG_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
408408
CHATMSG_JOB_ID: ${{ matrix.label }}
409-
if: failure() && github.event_name == 'push' && env.GCHAT_API_URL != '' && github.ref_name == 'main'
409+
if: failure() && github.ref_name == 'main' && github.event_name == 'push' && env.GCHAT_API_URL != ''
410410
run: bash ./.github/workflows/build_steps.sh notify_team_chat
411411

412412

@@ -451,5 +451,5 @@ jobs:
451451
CHATMSG_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
452452
CHATMSG_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
453453
CHATMSG_JOB_ID: ${{ env.label }}
454-
if: failure() && github.event_name == 'push' && env.GCHAT_API_URL != '' && github.ref_name == 'main'
454+
if: failure() && github.ref_name == 'main' && github.event_name == 'push' && env.GCHAT_API_URL != ''
455455
run: bash ./.github/workflows/build_steps.sh notify_team_chat

include/mujoco/mjplugin.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,20 @@ typedef struct mjSDF_ mjSDF;
199199
#define LINKER_NAME "_mj_ptr_"
200200
#endif
201201

202+
#if !defined(mjEXTERNC)
203+
#if defined(__cplusplus)
204+
#define mjEXTERNC extern "C"
205+
#else
206+
#define mjEXTERNC
207+
#endif // defined(__cplusplus)
208+
#endif // !defined(mjEXTERNC)
209+
202210
#pragma section(".CRT$XCU", read)
203211

204212
#define mjPLUGIN_LIB_INIT(n) \
205213
static void __cdecl _mj_init_##n(void); \
206214
/* We use extern "C" to prevent C++ name mangling */ \
207-
extern "C" __declspec(allocate(".CRT$XCU")) \
215+
mjEXTERNC __declspec(allocate(".CRT$XCU")) \
208216
void (__cdecl * _mj_ptr_##n)(void) = _mj_init_##n; \
209217
/* Force the linker to include the pointer symbol */ \
210218
__pragma(comment(linker, "/include:" LINKER_NAME #n)) \

0 commit comments

Comments
 (0)