Richard Boegli's CnC_Generals_Zero_Hour Fork
WIP
This is documentation of Richard Boegil's Zero Hour Fork
Loading...
Searching...
No Matches
sem4.h
Go to the documentation of this file.
1
/*
2
** Command & Conquer Generals Zero Hour(tm)
3
** Copyright 2025 Electronic Arts Inc.
4
**
5
** This program is free software: you can redistribute it and/or modify
6
** it under the terms of the GNU General Public License as published by
7
** the Free Software Foundation, either version 3 of the License, or
8
** (at your option) any later version.
9
**
10
** This program is distributed in the hope that it will be useful,
11
** but WITHOUT ANY WARRANTY; without even the implied warranty of
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
** GNU General Public License for more details.
14
**
15
** You should have received a copy of the GNU General Public License
16
** along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef SEM4_HEADER
20
#define SEM4_HEADER
21
22
#include <limits.h>
23
#ifndef _WINDOWS
24
#include <unistd.h>
25
#endif
26
#include "
wstypes.h
"
27
28
#ifdef _REENTRANT
29
#ifndef _WINDOWS
30
#include <semaphore.h>
31
#else
32
#include <windows.h>
33
#endif
// _WINDOWS
34
#endif
// _REENTRANT
35
36
// Windows headers have a tendency to redefine IN
37
#ifdef IN
38
#undef IN
39
#endif
40
#define IN const
41
42
class
Sem4
43
{
44
private
:
45
#ifdef _REENTRANT
46
#ifndef _WINDOWS
47
sem_t sem;
48
#else
49
HANDLE sem;
50
#endif
51
#endif
52
public
:
53
Sem4
();
54
Sem4
(
uint32
value
);
55
~Sem4
();
56
57
sint32
Wait
(
void
)
const
;
58
sint32
TryWait
(
void
)
const
;
59
sint32
Post
(
void
)
const
;
60
sint32
GetValue
(
int
*sval)
const
;
61
sint32
Destroy
(
void
);
62
};
63
64
#endif
value
void const char * value
Definition
DebugWindow.cpp:206
uint32
unsigned long uint32
Definition
bittype.h:46
sint32
signed long sint32
Definition
bittype.h:51
Sem4
Definition
sem4.h:43
Sem4::Sem4
Sem4(uint32 value)
Sem4::Sem4
Sem4()
Sem4::Wait
sint32 Wait(void) const
Sem4::GetValue
sint32 GetValue(int *sval) const
Sem4::Destroy
sint32 Destroy(void)
Sem4::Post
sint32 Post(void) const
Sem4::~Sem4
~Sem4()
Sem4::TryWait
sint32 TryWait(void) const
wstypes.h
Code
Tools
matchbot
wlib
sem4.h
Generated by
1.13.2