Particle acceleration around massive stars and X-ray binaries