Print

Print


Pretty easy. Put the header with an "extern" definition to he function which is defined in the corresponding "cc" file. So, here we have (I shortened the names to make them more manageable):

XrdFileCache/posix_fallocate_osx.hh -> XrdSys/XrdSysFallocate.hh
If the have something like this

#ifndef APPLE
#include <fcntl.h>
#else
........ the whole thing sans the function body with the following....
extern int posix_fallocate(int fd, off_t offset, off_t len);
#endif

Then place the actual function body in
XrdSys/XrdSysFallocate.cc

Make sure to if/def it so it only compiles on macOS.

Then in add the header and cc file entry in XrdUtils.cmake in the obvious place.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/xrootd/xrootd","title":"xrootd/xrootd","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/xrootd/xrootd"}},"updates":{"snippets":[{"icon":"PERSON","message":"@abh3 in #827: Pretty easy. Put the header with an \"extern\" definition to he function which is defined in the corresponding \"cc\" file. So, here we have (I shortened the names to make them more manageable):\r\n\r\nXrdFileCache/posix_fallocate_osx.hh -\u003e XrdSys/XrdSysFallocate.hh\r\nIf the have something like this\r\n\r\n#ifndef __APPLE__\r\n#include \u003cfcntl.h\u003e\r\n#else \r\n........ the whole thing sans the function body with the following....\r\nextern int posix_fallocate(int fd, off_t offset, off_t len);\r\n#endif \r\n----------------\r\nThen place the actual function body in \r\nXrdSys/XrdSysFallocate.cc\r\n\r\nMake sure to if/def it so it only compiles on macOS.\r\n\r\nThen in add the header and cc file entry in XrdUtils.cmake in the obvious place."}],"action":{"name":"View Pull Request","url":"https://github.com/xrootd/xrootd/pull/827#issuecomment-422957813"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/xrootd/xrootd/pull/827#issuecomment-422957813", "url": "https://github.com/xrootd/xrootd/pull/827#issuecomment-422957813", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [xrootd/xrootd] [Pfc] Fix compilation on OSX (#827)", "sections": [ { "text": "", "activityTitle": "**Andrew Hanushevsky**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@abh3", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"xrootd/xrootd\",\n\"issueId\": 827,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close pull request", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"PullRequestClose\",\n\"repositoryFullName\": \"xrootd/xrootd\",\n\"pullRequestId\": 827\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/xrootd/xrootd/pull/827#issuecomment-422957813" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 381858657\n}" } ], "themeColor": "26292E" } ]

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1