Skip to content

Commit b4b91bc

Browse files
committed
Move windows headers to port.c
This prevents the inclusion of windows.h. into all header files using FreeRTOS.h and thus defining several macros conflicting with common definitions.
1 parent 2da35de commit b4b91bc

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

portable/MSVC-MingW/port.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
#include "FreeRTOS.h"
3434
#include "task.h"
3535

36+
#ifdef WIN32_LEAN_AND_MEAN
37+
#include <winsock2.h>
38+
#else
39+
#include <winsock.h>
40+
#endif
41+
42+
#include <timeapi.h>
43+
3644
#ifdef __GNUC__
3745
#include "mmsystem.h"
3846
#else

portable/MSVC-MingW/portmacro.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,6 @@
2929
#ifndef PORTMACRO_H
3030
#define PORTMACRO_H
3131

32-
#ifdef WIN32_LEAN_AND_MEAN
33-
#include <winsock2.h>
34-
#else
35-
#include <winsock.h>
36-
#endif
37-
38-
#include <windows.h>
39-
#include <timeapi.h>
40-
#include <mmsystem.h>
41-
#include <winbase.h>
42-
4332
#ifdef __cplusplus
4433
extern "C" {
4534
#endif

0 commit comments

Comments
 (0)