[CDRIVER-1577] Declare __cdecl as calling convention on Windows Created: 04/Oct/16  Updated: 13/Dec/16  Resolved: 12/Dec/16

Status: Closed
Project: C Driver
Component/s: Build, libbson, libmongoc
Affects Version/s: None
Fix Version/s: 1.6.0

Type: Improvement Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-1167 clang-format config Closed

 Description   

This doesn't seem to impact other c apps on windows using mongoc, but when compiling c++ then the user may be tempted to change the calling convention:
https://msdn.microsoft.com/en-us/library/zkwh89ks.aspx

Unless we specifically declare which calling convention our API expects, things might get muddy.



 Comments   
Comment by Githook User [ 13/Dec/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1577 BSON_CALL should always be defined
Branch: master
https://github.com/mongodb/libbson/commit/46c26042c643192621250f0f09598a9537967fe3

Comment by Githook User [ 12/Dec/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1577 Declare __cdecl as calling convention on Windows
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/482374fac4abf7dd21cc881581d72ac4d6e6e622

Comment by Githook User [ 12/Dec/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1577 Declare __cdecl as calling convention on Windows
Branch: master
https://github.com/mongodb/libbson/commit/693e32f1d8bb2c97a7c5d7a77fda0e3d1f712aca

Comment by A. Jesse Jiryu Davis [ 28/Oct/16 ]

I like the BSON_EXPORT idea best. I have no objection to running uncrustify on all headers.

  • In one commit, remove all the ASCII-art whitespace, which we can't maintain forever anyway. From now on, changing one function signature doesn't require reformatting any other function signatures.
  • In the same commit, since every public header line is changing anyway, introduce BSON_EXPORT.
Generated at Wed Feb 07 21:12:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.