Skip to content

Conversation

@masali-hp
Copy link

To compile for Visual C / WIN32 the following changes were required:

(multiple files)

  • inline was defined as __inline
  • variable declarations were moved to the beginning of scope blocks.
  • partially expanded GSK_LIST_* macros. (macros are expanded differently
    under Visual C than they are udner gcc).
  • Removed support for PROTOBUF_C_RPC_ADDRESS_LOCAL; it depends on AF_UNIX.
  • Removed support for protobuf_c_rpc_server_configure_threading;
    it depends on pipe(). Windows has pipe support (using CreatePipe) but
    has different semantics.

protobuf-c-rpc-dispatch.c

  • Replaced FDMap sparsed array with sorted array of FDMap.
  • Replaced timer tree with a sorted linked list.
    Neither of these changes are quite as efficient as how the code was
    previously; however the number of FDs or timers would have to be very
    large to see a performance impact.
    Because macro expansion works differently in VC than gcc, the red-black
    tree code is impossible to compile, even attempting to partially
    expand the initial macros.

To compile for Windows CE:

  • errno defined to WSAGetLastError()
  • strerror implemented using FormatMessage.
  • non-polling (select) based dispatch model implemented.

Signed-off-by: Mark Salisbury [email protected]

To compile for Visual C / WIN32 the following changes were required:

(multiple files)
+ inline was defined as __inline
+ variable declarations were moved to the beginning of scope blocks.
+ partially expanded GSK_LIST_* macros.  (macros are expanded differently
  under Visual C than they are udner gcc).
+ Removed support for PROTOBUF_C_RPC_ADDRESS_LOCAL; it depends on AF_UNIX.
+ Removed support for protobuf_c_rpc_server_configure_threading;
  it depends on pipe().  Windows has pipe support (using CreatePipe) but
  has different semantics.

protobuf-c-rpc-dispatch.c
+ Replaced FDMap sparsed array with sorted array of FDMap.
+ Replaced timer tree with a sorted linked list.
  Neither of these changes are quite as efficient as how the code was
  previously; however the number of FDs or timers would have to be very
  large to see a performance impact.
  Because macro expansion works differently in VC than gcc, the red-black
  tree code is impossible to compile, even attempting to partially
  expand the initial macros.

To compile for Windows CE:
+ errno defined to WSAGetLastError()
+ strerror implemented using FormatMessage.
+ non-polling (select) based dispatch model implemented.

Signed-off-by: Mark Salisbury <[email protected]>
@lipnitsk
Copy link
Member

lipnitsk commented May 9, 2016

Hi Mark,
Thank you for the changes. I had some questions:

  1. The tests appear to fail with your changes, can you take a look why?
  2. I would prefer if you separated the pull request into multiple commits (git add -p is handy for that) for easier review, for example:
  • win32-only changes
  • Changes that affect both Linux and Win32
  • Whitespace or other changes that don't affect the compiled code

Looking at changes in smaller batches would help identify potential problems. Would you be able to separate the changes?

@masali-hp
Copy link
Author

Thanks Ilya. I'll need to figure out how to run the tests locally... Looking at the log, it says:

"No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself."

After the "verify client cannot connect" test begins.

The changes can't be really broken down much since the point of the changes is to compile with VS 2008 for Windows platforms. It may be possible to reduce the turmoil to some degree by not including changes for running on Windows CE.

@deserthacker
Copy link

It seems like some of these could come in separate from the Win32 and WinCE changes.

Maybe these ones:

  • inline was defined as __inline (I think this was WIN32 specific though)
  • variable declarations were moved to the beginning of scope blocks.
  • partially expanded GSK_LIST_* macros. (macros are expanded differently under Visual C than they are under gcc).
  • Removed support for protobuf_c_rpc_server_configure_threading; it depends on pipe(). Windows has pipe support (using CreatePipe) but has different semantics. )Not sure if this was Win32 only though...)

protobuf-c-rpc-dispatch.c

  • Replaced FDMap sparsed array with sorted array of FDMap.
  • Replaced timer tree with a sorted linked list. Neither of these changes are quite as efficient as how the code was previously; however the number of FDs or timers would have to be very large to see a performance impact. Because macro expansion works differently in VC than gcc, the red-black tree code is impossible to compile, even attempting to partially expand the initial macros.

I think it can be broken apart, not fun but do-able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants