windows.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef WINDOWS_H
19 #define WINDOWS_H
20 
21 
22 #include <sys/select.h>
23 
24 inline void Sleep(long dwMilliseconds)
25 {
26  ::timeval sleepTime = {0, dwMilliseconds * 1000};
27  ::select(0, 0, 0, 0, &sleepTime);
28 }
29 
30 
31 //#ifndef HANDLE
32 //typedef int HANDLE;
33 //#endif
34 //typedef int DWORD;
35 typedef unsigned char BYTE;
36 enum {
37  FALSE = false,
38  TRUE = true
39 };
40 
41 
42 inline int min(int a, int b)
43 {
44  return (a < b) ? a : b;
45 }
46 
47 
48 inline int max(int a, int b)
49 {
50  return (a > b) ? a : b;
51 }
52 
53 
54 
55 #endif
56 
Definition: windows.h:38
int max(int a, int b)
Definition: windows.h:48
Definition: windows.h:37
int min(int a, int b)
Definition: windows.h:42
unsigned char BYTE
Definition: windows.h:35
void Sleep(long dwMilliseconds)
Definition: windows.h:24


cob_utilities
Author(s): Christian Connette
autogenerated on Wed Apr 7 2021 02:11:52