Skip to content

Fix the MSVC build - #5182

Merged
jturcotte merged 2 commits into
owncloud:masterfrom
jturcotte:msvcBuild
Sep 20, 2016
Merged

jturcotte merged 2 commits into
owncloud:masterfrom
jturcotte:msvcBuild

Conversation

@jturcotte

Copy link
Copy Markdown
Contributor
  • Replace functions that are provided by MinGW with a Win32-based
    implementation
  • Explicitly export needed symbols from ocsync.dll
  • Rename share.h to sharemanager.h since the name clashes with one
    of the Windows headers and get included from there
  • Remove the timestamp from the fallback csync stderr logging, it's
    not used since we always provide a log callback

@mention-bot

Copy link
Copy Markdown

@jturcotte, thanks for your PR! By analyzing the annotation information on this pull request, we identified @rullzer, @ckamm and @gladiac to be potential reviewers

@jturcotte

Copy link
Copy Markdown
Contributor Author

/cc @ogoffart

@ogoffart ogoffart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you make sure it still compile with mingw?

(why was it needed to rename share.h ?)

Comment thread CMakeLists.txt Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's both for MSVC and mingw, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, same for _WIN32 in the code, it applies to both MSVC and MinGW

Comment thread cmake/modules/Warnings.cmake Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, was that not more correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They just recommend to use the compiler ID if we want to target both Clang and GCC, my last commit to that file was getting stuff out of that block for Clang, but now I need to keep MSVC out of it.

Comment thread csync/src/csync_exclude.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have had problems with off_t before (see commit 4f5bfbd )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK that one was only a warning so I'll remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread csync/src/csync_log.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we don"t really need the date...
Then the two fprintf can be merged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't test that code (at least not on windows), and it won't run anyway so I'd prefer to just cut what I know won't break anything.

Comment thread csync/src/std/asprintf.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the file go in 3rdparty?
Should there be a URL from the readme on where this came from, and which revision. ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unlikely we'll update that code ever again so I think it's not worth it to start referencing files across the filesystem to 3rdparty in the cmake files.

Where should I put the URL, in the file itself?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've put the URL in the file headers.

- Replace functions that are provided by MinGW with a Win32-based
  implementation
- Explicitly export needed symbols from ocsync.dll
- Rename share.h to sharemanager.h since the name clashes with one
  of the Windows headers and get included from there
- Remove the timestamp from the fallback csync stderr logging, it's
  not used since we always provide a log callback
The compiler complained about the PathComponent reference on the lambdas comes from the anonymous namespace.
@jturcotte

Copy link
Copy Markdown
Contributor Author

Please look at the commit message for the reason why renaming share.h was necessary.

@ogoffart

Copy link
Copy Markdown
Contributor

👍

@jturcotte
jturcotte merged commit 31aaf95 into owncloud:master Sep 20, 2016
@jturcotte
jturcotte deleted the msvcBuild branch September 20, 2016 08:39
@guruz guruz added this to the 2.3.0 milestone Oct 16, 2016
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.

4 participants