Skip to content

Commit

Permalink
wfreerdp: fix build on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
awakecoding committed Mar 29, 2013
1 parent a318f8f commit c65ee0c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
1 change: 0 additions & 1 deletion server/Mac/mf_rdpsnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ AQRecorderState recorderState;

static const AUDIO_FORMAT supported_audio_formats[] =
{

{ WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, NULL },
{ WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, NULL }
};
Expand Down
14 changes: 7 additions & 7 deletions server/Windows/wf_rdpsnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@

#endif

static const AUDIO_FORMAT audio_formats[] =
{
{ WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, NULL },
{ WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, NULL }
static const AUDIO_FORMAT supported_audio_formats[] =
{
{ WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0, NULL },
{ WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL }
};

static void wf_peer_rdpsnd_activated(rdpsnd_server_context* context)
Expand All @@ -65,7 +65,7 @@ static void wf_peer_rdpsnd_activated(rdpsnd_server_context* context)
(context->client_formats[i].nSamplesPerSec == context->server_formats[j].nSamplesPerSec))
{
printf("agreed on format!\n");
wfi->agreed_format = (AUDIO_FORMAT*)&context->server_formats[j];
wfi->agreed_format = (AUDIO_FORMAT*) &context->server_formats[j];
break;
}
}
Expand Down Expand Up @@ -149,9 +149,9 @@ BOOL wf_peer_rdpsnd_init(wfPeerContext* context)
context->rdpsnd = rdpsnd_server_context_new(context->vcm);
context->rdpsnd->data = context;

context->rdpsnd->server_formats = audio_formats;
context->rdpsnd->server_formats = supported_audio_formats;
context->rdpsnd->num_server_formats =
sizeof(audio_formats) / sizeof(audio_formats[0]);
sizeof(supported_audio_formats) / sizeof(supported_audio_formats[0]);

context->rdpsnd->src_format.wFormatTag = 1;
context->rdpsnd->src_format.nChannels = 2;
Expand Down
4 changes: 4 additions & 0 deletions winpr/libwinpr/environment/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ set(MODULE_PREFIX "WINPR_ENVIRONMENT")
set(${MODULE_PREFIX}_SRCS
environment.c)

if(MSVC AND (NOT MONOLITHIC_BUILD))
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def)
endif()

add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"
MONOLITHIC ${MONOLITHIC_BUILD}
SOURCES ${${MODULE_PREFIX}_SRCS})
Expand Down
2 changes: 2 additions & 0 deletions winpr/libwinpr/environment/module.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LIBRARY "libwinpr-environment"
EXPORTS
2 changes: 1 addition & 1 deletion winpr/libwinpr/utils/test/TestPrint.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int TestPrint(int argc, char* argv[])
_printf("%d\n",b);
_printf("%3d\n",b);
_printf("%03d\n",b);
c = 15.3; d = c / 3;
c = 15.3f; d = c / 3;
_printf("%3.2f\n",d);

/**
Expand Down
9 changes: 9 additions & 0 deletions winpr/libwinpr/utils/trio/trio.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ typedef trio_longlong_t trio_int64_t;
* Internal Definitions
*/

#ifdef _WIN32
#pragma warning(push)
#pragma warning(disable: 4244)
#endif

#if TRIO_FEATURE_FLOAT

# if !defined(DECIMAL_DIG)
Expand Down Expand Up @@ -7846,3 +7851,7 @@ TRIO_ARGS1((errorcode),
return "Unknown";
#endif
}

#ifdef _WIN32
#pragma warning(pop)
#endif

0 comments on commit c65ee0c

Please sign in to comment.