netdev-dpdk: fix mbuf leaks
[cascardo/ovs.git] / lib / stdio.h.in
1 /*
2  * Copyright (c) 2013 Nicira, Inc.
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 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
18
19 #if !defined STDIO_H_WRAPPER
20 #define STDIO_H_WRAPPER 1
21
22 #ifdef _WIN32
23
24 #include <stdarg.h>
25 #include <stddef.h>
26 #include <sys/types.h>
27
28 /* Windows libc has defective snprintf() and vsnprintf():
29  *
30  *     - They return -1 if the output won't fit.
31  *
32  *     - They don't null-terminate the output if it won't fit.
33  *
34  * We need working versions so here we define substitutes. */
35 #undef snprintf
36 #define snprintf ovs_snprintf
37 int ovs_snprintf(char *, size_t, const char *, ...);
38
39 #undef vsnprintf
40 #define vsnprintf ovs_vsnprintf
41 int ovs_vsnprintf(char *, size_t, const char *, va_list);
42
43 int fseeko(FILE *stream, off_t offset, int whence);
44 #endif /* _WIN32 */
45
46 #endif /* stdio.h wrapper */