OpenCPN Partial API docs
Loading...
Searching...
No Matches
cutil.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2010 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#ifndef CUTIL_H_
25#define CUTIL_H_
26
27#include <vector>
28
29#ifdef __MSVC__
30#include <winsock2.h>
31#include <windows.h>
32#endif
33
34#include <wx/dynarray.h>
35
36#ifdef __cplusplus
37
38extern "C" int mysnprintf(char *buffer, int count, const char *format, ...);
39extern "C" int NextPow2(int size);
40
41#else /* __cplusplus */
42extern int mysnprintf(char *buffer, int count, const char *format, ...);
43#endif
44
45#ifdef __MSVC__
46#ifdef __cplusplus
47extern "C" long __stdcall MyUnhandledExceptionFilter(
48 struct _EXCEPTION_POINTERS *ExceptionInfo);
49#else
50extern long __stdcall MyUnhandledExceptionFilter(
51 struct _EXCEPTION_POINTERS *ExceptionInfo);
52#endif
53#endif
54
55#ifdef __WXMSW__
56#define clock_gettime(id, tv) clock_gettime_monotonic(tv)
57#define CLOCK_MONOTONIC 1
58extern "C" int clock_gettime_monotonic(struct timespec *tv);
59#endif
60
61#endif // CUTIL_H_