[wpiutil] Rename CreateEvent and CreateSemaphore to Make (#8710)

CreateEvent and CreateSemaphore are macros in Windows.h, which causes a
ton of trouble. Just rename the functions.

Closes #7303

Replaces #7336
This commit is contained in:
Thad House
2026-03-30 15:54:42 -07:00
committed by GitHub
parent d248c040bf
commit bf218113db
20 changed files with 47 additions and 48 deletions

View File

@@ -112,7 +112,7 @@ public class WPIUtilJNI {
* @param initialState true to make the event initially in signaled state
* @return Event handle
*/
public static native int createEvent(boolean manualReset, boolean initialState);
public static native int makeEvent(boolean manualReset, boolean initialState);
/**
* Destroys an event. Destruction wakes up any waiters.
@@ -145,7 +145,7 @@ public class WPIUtilJNI {
* @param maximumCount maximum value for the semaphore's internal counter
* @return Semaphore handle
*/
public static native int createSemaphore(int initialCount, int maximumCount);
public static native int makeSemaphore(int initialCount, int maximumCount);
/**
* Destroys a semaphore. Destruction wakes up any waiters.

View File

@@ -22,7 +22,7 @@ public final class Event implements AutoCloseable {
* @param initialState true to make the event initially in signaled state
*/
public Event(boolean manualReset, boolean initialState) {
m_handle = WPIUtilJNI.createEvent(manualReset, initialState);
m_handle = WPIUtilJNI.makeEvent(manualReset, initialState);
}
/**

View File

@@ -21,7 +21,7 @@ public final class Semaphore implements AutoCloseable {
* @param maximumCount maximum value for the semaphore's internal counter
*/
public Semaphore(int initialCount, int maximumCount) {
m_handle = WPIUtilJNI.createSemaphore(initialCount, maximumCount);
m_handle = WPIUtilJNI.makeSemaphore(initialCount, maximumCount);
}
/**