Skip to content

Commit 287bc2e

Browse files
committed
Removed unused stdbool.h
Replaced all include guards with '#pragma once' - fixes OpenKinect#296 Signed-off-by: Benn Snyder <[email protected]>
1 parent a6c5dd0 commit 287bc2e

21 files changed

+24
-114
lines changed

include/libfreenect-audio.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
* either License.
2525
*/
2626

27-
#ifndef LIBFREENECT_AUDIO_H
28-
#define LIBFREENECT_AUDIO_H
27+
#pragma once
2928

3029
#include <libfreenect.h>
3130
#include <stdint.h>
@@ -114,7 +113,3 @@ FREENECTAPI int freenect_stop_audio(freenect_device* dev);
114113
#ifdef __cplusplus
115114
}
116115
#endif
117-
118-
#endif //
119-
120-

include/libfreenect-registration.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
* either License.
2525
*/
2626

27-
#ifndef LIBFREENECT_REGISTRATION_H
28-
#define LIBFREENECT_REGISTRATION_H
27+
#pragma once
2928

3029
#include <libfreenect.h>
3130
#include <stdint.h>
@@ -125,5 +124,3 @@ FREENECTAPI void freenect_camera_to_world(freenect_device* dev,
125124
#ifdef __cplusplus
126125
}
127126
#endif
128-
129-
#endif // LIBFREENECT_REGISTRATION_H

include/libfreenect.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
* either License.
2525
*/
2626

27-
#ifndef LIBFREENECT_H
28-
#define LIBFREENECT_H
27+
#pragma once
2928

3029
#include <stdint.h>
3130

@@ -618,6 +617,3 @@ FREENECTAPI int freenect_set_depth_mode(freenect_device* dev, const freenect_fra
618617
#ifdef __cplusplus
619618
}
620619
#endif
621-
622-
#endif //
623-

platform/windows/README.TXT

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,10 @@ on using the C-compiler to compile .c files (this happens with MSVC versions pri
6464
2010). To work around this, just set the "Compile As" to "Default", click "Apply" and
6565
then set it back to "Compile as C++ Code (/TP)", click "Apply" and then "OK".
6666

67-
Another problem is that Visual C++ does not offer the <unistd.h> and <stdbool.h>
68-
headers. However, they are pretty simple to be emulated; the <stdbool.h> will
69-
actually be a dummy header because C++ already defines the "bool" type semantics,
70-
while the <unistd.h> has to simply #include <stdint.h> and define the "ssize_t"
71-
type. The implementation of these headers are located at:
72-
"libfreenect\platform\windows"
67+
Another problem is that Visual C++ does not offer <unistd.h>. However, it
68+
can be emulated by #include <stdint.h> and defining the "ssize_t" type.
69+
The implementation of <unistd.h> is located at:
70+
"libfreenect\platform\windows\unistd.h"
7371

7472
NOTE: MSVC versions prior to 2010 do not provide the <stdint.h> header. An ISO C9x
7573
compilant <stdint.h> header for such MSVC versions can be found at the wikipedia entry

platform/windows/libusb10emu/libusb-1.0/failguard.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef LIBUSBEMU_FAIL_GUARD_H
2-
#define LIBUSBEMU_FAIL_GUARD_H
1+
#pragma once
32

43
namespace libusbemu
54
{
@@ -12,5 +11,3 @@ namespace libusbemu
1211
const bool Abort();
1312
}
1413
}
15-
16-
#endif//LIBUSBEMU_FAIL_GUARD_H

platform/windows/libusb10emu/libusb-1.0/libusb.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
* either License.
2525
*/
2626

27-
#ifndef LIBUSB_1_0_INTERFACE_EMULATOR_FOR_LIBUSB_0_1_H
28-
#define LIBUSB_1_0_INTERFACE_EMULATOR_FOR_LIBUSB_0_1_H
27+
#pragma once
2928

3029
// This interface emulator requires the libusb-win32 v1.2.2.1 (snapshot)
3130
// or later. Prior win32 versions of the library were not conformal to
@@ -198,5 +197,3 @@ enum libusb_error
198197
#ifdef __cplusplus
199198
}
200199
#endif
201-
202-
#endif//LIBUSB_1_0_INTERFACE_EMULATOR_FOR_LIBUSB_0_1_H

platform/windows/libusb10emu/libusb-1.0/libusbemu_internal.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
* either License.
2525
*/
2626

27-
#ifndef LIBUSB_EMULATOR_INTERNAL_H
28-
#define LIBUSB_EMULATOR_INTERNAL_H
27+
#pragma once
2928

3029
#include "libusbemu_threads.h"
3130
#include <lusb0_usb.h>
@@ -413,5 +412,3 @@ void libusbemu_clear_transfer(transfer_wrapper* wrapper)
413412
}
414413

415414
} // end of 'namespace libusbemu'
416-
417-
#endif//LIBUSB_EMULATOR_INTERNAL_H

platform/windows/libusb10emu/libusb-1.0/libusbemu_threads.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
* either License.
2525
*/
2626

27-
#ifndef LIBUSBEMU_THREAD_INTERFACE_WRAPPER_H
28-
#define LIBUSBEMU_THREAD_INTERFACE_WRAPPER_H
27+
#pragma once
2928

3029
// Wrappers for platform-specific thread/synchronization objects:
3130
// * Thread
@@ -56,6 +55,4 @@ struct RAIIMutex
5655
~RAIIMutex() { m_mutex.Leave(); }
5756
};
5857

59-
};
60-
61-
#endif//LIBUSBEMU_THREAD_INTERFACE_WRAPPER_H
58+
}

platform/windows/libusb10emu/libusb-1.0/libusbemu_threads_win32.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
* either License.
2525
*/
2626

27-
#ifndef LIBUSBEMU_THREAD_INTERFACE_WRAPPER_FOR_WIN32_THREADS_H
28-
#define LIBUSBEMU_THREAD_INTERFACE_WRAPPER_FOR_WIN32_THREADS_H
27+
#pragma once
2928

3029
#include <windows.h>
3130
#include <stdio.h>
@@ -320,5 +319,3 @@ struct EventList
320319
};
321320

322321
} //end of 'namespace libusbemu'
323-
324-
#endif//LIBUSBEMU_THREAD_INTERFACE_WRAPPER_FOR_WIN32_THREADS_H

platform/windows/stdbool.h

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)